/*
 * TECH_PULSE — Cyber-Industrial Vanguard
 * Main stylesheet. Design tokens + components + responsive layout.
 */

/* ============================================================
   TOKENS
   ============================================================ */
:root {
	/* Surfaces */
	--tp-bg: #131313;
	--tp-bg-deep: #0e0e0e;
	--tp-surface-1: #1a1a1a;
	--tp-surface-2: #1f1f1f;
	--tp-surface-3: #2a2a2a;
	--tp-surface-4: #353535;

	/* Accent (the Pulse) */
	--tp-accent: #ff0000;
	--tp-accent-tint: rgba(255, 0, 0, 0.1);
	--tp-glow: 0 0 15px rgba(255, 0, 0, 0.55);

	/* Text & lines */
	--tp-text: #ffffff;
	--tp-text-muted: #e2e2e2;
	--tp-text-dim: #8a8a8a;
	--tp-border: #262626;
	--tp-border-active: var(--tp-accent);

	/* Fonts */
	--tp-font-head: "Sora", system-ui, sans-serif;
	--tp-font-body: "Inter", system-ui, sans-serif;
	--tp-font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

	/* Spacing */
	--tp-gutter: 24px;
	--tp-margin: 64px;
	--tp-grid-size: 32px;

	/* Layout */
	--tp-maxw: 1280px;
	--tp-chamfer: 14px;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background-color: var(--tp-bg);
	color: var(--tp-text);
	font-family: var(--tp-font-body);
	font-size: 16px;
	line-height: 1.6;
	overflow-x: hidden;
	position: relative;
}

/* Blueprint grid background (Level 0) */
.tp-grid-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
	background-size: var(--tp-grid-size) var(--tp-grid-size);
	mask-image: radial-gradient(ellipse at 50% 0%, #000 40%, transparent 100%);
}

body > *:not(.tp-grid-bg) {
	position: relative;
	z-index: 1;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover {
	color: var(--tp-accent);
}

h1, h2, h3, h4 {
	font-family: var(--tp-font-head);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.02em;
	margin: 0 0 0.5em;
}

p {
	margin: 0 0 1.2em;
}

/* Mono utility */
.tp-mono {
	font-family: var(--tp-font-mono);
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.tp-accent {
	color: var(--tp-accent);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.tp-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100;
	background: var(--tp-accent);
	color: #000;
	padding: 10px 16px;
	font-family: var(--tp-font-mono);
}

.tp-skip-link:focus {
	left: 8px;
	top: 8px;
	color: #000;
}

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */
.tp-container {
	width: 100%;
	max-width: var(--tp-maxw);
	margin-inline: auto;
	padding-inline: var(--tp-margin);
}

.tp-section {
	padding-block: 56px;
}

.tp-section__head {
	margin-bottom: 32px;
	border-bottom: 1px solid var(--tp-border);
	padding-bottom: 16px;
}

.tp-section__kicker {
	display: block;
	color: var(--tp-accent);
	font-size: 13px;
	margin-bottom: 8px;
}

.tp-section__title {
	font-size: clamp(28px, 4vw, 40px);
	text-transform: uppercase;
	margin: 0;
}

.tp-grid {
	display: grid;
	gap: var(--tp-gutter);
}

.tp-grid--cards {
	grid-template-columns: repeat(3, 1fr);
}

.tp-empty {
	color: var(--tp-text-dim);
	border: 1px dashed var(--tp-border);
	padding: 32px;
	text-align: center;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.tp-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(19, 19, 19, 0.72);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--tp-border);
	transition: border-color 0.3s ease, background 0.3s ease;
}

.tp-header.is-scrolled {
	border-bottom-color: var(--tp-accent);
	background: rgba(14, 14, 14, 0.85);
}

.tp-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 64px;
}

.tp-brand__mark {
	font-family: var(--tp-font-head);
	font-weight: 800;
	font-size: 22px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--tp-text);
}

.tp-brand__accent {
	color: var(--tp-accent);
}

.tp-nav {
	display: flex;
	align-items: center;
	gap: 28px;
}

.tp-menu {
	display: flex;
	align-items: center;
	gap: 22px;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
}

.tp-menu li {
	position: relative;
}

.tp-menu a {
	color: var(--tp-text-muted);
	padding: 6px 0;
	transition: color 0.2s ease;
}

.tp-menu a:hover,
.tp-menu .current-menu-item > a,
.tp-menu .current-cat > a {
	color: var(--tp-accent);
	text-shadow: var(--tp-glow);
}

/* Sub-menus */
.tp-menu ul.sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	background: var(--tp-surface-1);
	border: 1px solid var(--tp-border);
	list-style: none;
	margin: 8px 0 0;
	padding: 8px 0;
	display: none;
	z-index: 60;
}

.tp-menu li:hover > ul.sub-menu {
	display: block;
}

.tp-menu ul.sub-menu a {
	display: block;
	padding: 8px 16px;
}

.tp-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--tp-text-dim);
	border: 1px solid var(--tp-border);
	padding: 6px 10px;
}

.tp-status__dot {
	width: 8px;
	height: 8px;
	background: var(--tp-accent);
	border-radius: 50%;
	box-shadow: var(--tp-glow);
	animation: tp-pulse 1.6s ease-in-out infinite;
}

@keyframes tp-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.35; }
}

.tp-nav-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 9px;
	background: transparent;
	border: 1px solid var(--tp-border);
	cursor: pointer;
}

.tp-nav-toggle__bar {
	display: block;
	height: 2px;
	width: 100%;
	background: var(--tp-text);
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.tp-nav-toggle[aria-expanded="true"] .tp-nav-toggle__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.tp-nav-toggle[aria-expanded="true"] .tp-nav-toggle__bar:nth-child(2) {
	opacity: 0;
}
.tp-nav-toggle[aria-expanded="true"] .tp-nav-toggle__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   BUTTONS / CHIPS / INPUTS
   ============================================================ */
.tp-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--tp-font-mono);
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 12px 22px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: box-shadow 0.2s ease, background 0.2s ease, transform 0.15s ease, color 0.2s ease;
	clip-path: polygon(var(--tp-chamfer) 0, 100% 0, 100% calc(100% - var(--tp-chamfer)), calc(100% - var(--tp-chamfer)) 100%, 0 100%, 0 var(--tp-chamfer));
}

.tp-btn--primary {
	background: var(--tp-accent);
	color: #000;
}

.tp-btn--primary:hover {
	color: #000;
	box-shadow: var(--tp-glow);
	transform: translateY(-1px);
}

.tp-btn--ghost {
	background: transparent;
	border-color: var(--tp-accent);
	color: var(--tp-accent);
}

.tp-btn--ghost:hover {
	background: var(--tp-accent-tint);
	box-shadow: var(--tp-glow);
}

.tp-chip {
	display: inline-flex;
	align-items: center;
	font-family: var(--tp-font-mono);
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 5px 10px;
	color: var(--tp-accent);
	border: 1px solid var(--tp-accent);
	background: var(--tp-accent-tint);
	transition: box-shadow 0.2s ease, background 0.2s ease;
}

.tp-chip:hover,
.tp-chip.is-active {
	color: #000;
	background: var(--tp-accent);
	box-shadow: var(--tp-glow);
}

.tp-chip--ghost {
	color: var(--tp-text-dim);
	border-color: var(--tp-border);
	background: transparent;
}

.tp-chip--ghost:hover {
	color: var(--tp-accent);
	border-color: var(--tp-accent);
	background: var(--tp-accent-tint);
}

.tp-input {
	background: var(--tp-bg-deep);
	border: 1px solid var(--tp-border);
	color: var(--tp-text);
	font-size: 13px;
	padding: 12px 14px;
	width: 100%;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tp-input::placeholder {
	color: var(--tp-text-dim);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.tp-input:focus {
	outline: none;
	border-color: var(--tp-accent);
	box-shadow: var(--tp-glow);
}

/* ============================================================
   HERO
   ============================================================ */
.tp-hero {
	border-bottom: 1px solid var(--tp-border);
	background:
		radial-gradient(circle at 80% 20%, rgba(255, 0, 0, 0.12), transparent 45%),
		var(--tp-bg-deep);
}

.tp-hero__inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	align-items: center;
	padding-block: 72px;
}

.tp-hero__label {
	display: inline-block;
	color: var(--tp-accent);
	font-size: 13px;
	margin-bottom: 16px;
	border-left: 3px solid var(--tp-accent);
	padding-left: 10px;
}

.tp-hero__title {
	font-size: clamp(30px, 3.6vw, 52px);
	line-height: 1.06;
	letter-spacing: -0.03em;
	text-transform: uppercase;
	font-style: normal;
	margin-bottom: 20px;
	color: var(--tp-text);
	overflow-wrap: break-word;
	word-break: break-word;
	hyphens: auto;
	/* Cap very long headlines so the hero stays balanced */
	display: -webkit-box;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tp-hero__title a {
	color: inherit;
}

.tp-hero__title a:hover {
	color: var(--tp-accent);
}

.tp-hero__excerpt {
	color: var(--tp-text-muted);
	font-size: 18px;
	max-width: 46ch;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tp-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 24px 0;
}

.tp-hero__media {
	position: relative;
	border: 1px solid var(--tp-border);
	clip-path: polygon(var(--tp-chamfer) 0, 100% 0, 100% calc(100% - var(--tp-chamfer)), calc(100% - var(--tp-chamfer)) 100%, 0 100%, 0 var(--tp-chamfer));
	overflow: hidden;
}

/* Placeholder shown when the hero post has no featured image */
.tp-hero__placeholder {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	background-color: var(--tp-bg-deep);
	background-image:
		radial-gradient(circle at 70% 35%, rgba(255, 0, 0, 0.30), transparent 55%),
		linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
	background-size: auto, var(--tp-grid-size) var(--tp-grid-size), var(--tp-grid-size) var(--tp-grid-size);
}

.tp-hero__placeholder::after {
	content: "// NO_VISUAL_FEED";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--tp-font-mono);
	font-size: 13px;
	letter-spacing: 0.08em;
	color: var(--tp-text-dim);
}

/* ============================================================
   THUMBS + SCANLINE
   ============================================================ */
.tp-thumb {
	position: relative;
	margin: 0;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: var(--tp-surface-2);
}

.tp-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.tp-thumb__scan {
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s ease;
	background: repeating-linear-gradient(
		to bottom,
		rgba(255, 0, 0, 0.06) 0,
		rgba(255, 0, 0, 0.06) 1px,
		transparent 1px,
		transparent 4px
	);
}

/* ============================================================
   STATUS TRACKERS
   ============================================================ */
.tp-trackers {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--tp-gutter);
	padding-block: 32px;
}

.tp-tracker {
	border: 1px solid var(--tp-border);
	background: var(--tp-surface-1);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tp-tracker__key {
	color: var(--tp-text-dim);
	font-size: 11px;
}

.tp-tracker__val {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--tp-font-mono);
	font-size: 15px;
	color: var(--tp-text);
}

/* ============================================================
   MAIN + SIDEBAR LAYOUT
   ============================================================ */
.tp-layout {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: 48px;
	padding-block: 56px;
}

.tp-panel {
	border: 1px solid var(--tp-border);
	background: var(--tp-surface-1);
	padding: 20px;
	margin-bottom: 24px;
}

.tp-panel__title {
	color: var(--tp-accent);
	font-size: 13px;
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--tp-border);
}

/* ============================================================
   CARDS
   ============================================================ */
.tp-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--tp-border);
	background: var(--tp-surface-1);
	transition: border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.tp-card:hover {
	border-color: var(--tp-border-active);
	transform: translateY(-3px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.tp-card:hover .tp-thumb__scan {
	opacity: 1;
}

.tp-card:hover .tp-thumb img {
	transform: scale(1.05);
}

.tp-card__body {
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
}

.tp-card__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-size: 11px;
	color: var(--tp-text-dim);
}

.tp-card__title {
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
	margin: 0;
	text-transform: none;
	letter-spacing: -0.01em;
}

.tp-card__excerpt {
	color: var(--tp-text-dim);
	font-size: 14px;
	margin: 0;
}

.tp-card__cta {
	margin-top: auto;
	color: var(--tp-accent);
	font-size: 12px;
}

/* ============================================================
   FEED ROWS
   ============================================================ */
.tp-feed {
	display: grid;
	grid-template-columns: 64px 1fr;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid var(--tp-border);
}

.tp-feed:last-child {
	border-bottom: 0;
}

.tp-feed__thumb {
	width: 64px;
	height: 64px;
	overflow: hidden;
	background: var(--tp-surface-2);
	border: 1px solid var(--tp-border);
}

.tp-feed__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tp-feed__title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	margin: 6px 0 0;
	text-transform: none;
	letter-spacing: 0;
}

.tp-feed__meta {
	font-size: 10px;
}

/* ============================================================
   ARTICLE / SINGLE
   ============================================================ */
/* Hero with title overlaid on the image */
.tp-article__hero--overlay {
	position: relative;
	border-bottom: 1px solid var(--tp-border);
	background: var(--tp-bg-deep);
}

.tp-article__hero-media {
	position: relative;
	width: 100%;
	height: clamp(360px, 60vh, 620px);
	overflow: hidden;
}

.tp-article__hero-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tp-article__hero-placeholder {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle at 70% 30%, rgba(255, 0, 0, 0.28), transparent 55%),
		linear-gradient(135deg, #1a0303 0%, var(--tp-bg-deep) 60%),
		var(--tp-bg-deep);
	background-image:
		radial-gradient(circle at 70% 30%, rgba(255, 0, 0, 0.28), transparent 55%),
		linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
	background-size: auto, var(--tp-grid-size) var(--tp-grid-size), var(--tp-grid-size) var(--tp-grid-size);
}

.tp-article__hero-scan {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: repeating-linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0.18) 0,
		rgba(0, 0, 0, 0.18) 1px,
		transparent 1px,
		transparent 3px
	);
	opacity: 0.5;
}

/* Caption sits over the bottom of the hero image */
.tp-article__hero-caption {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	padding-block: 40px;
	background: linear-gradient(to top, rgba(14, 14, 14, 0.96) 8%, rgba(14, 14, 14, 0.6) 55%, transparent 100%);
}

.tp-article__title {
	font-size: clamp(30px, 5vw, 56px);
	text-transform: uppercase;
	line-height: 1.05;
	margin: 12px 0 16px;
	max-width: 20ch;
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.tp-article__hero-readout {
	display: flex;
	flex-wrap: wrap;
	gap: 22px;
	font-size: 12px;
	color: var(--tp-text-muted);
	border-left: 2px solid var(--tp-accent);
	padding-left: 12px;
}

.tp-article__hero-readout .tp-key {
	color: var(--tp-accent);
}

/* Three-column reading layout: share rail | body | gear */
.tp-article__layout {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) 320px;
	gap: 40px;
	padding-block: 48px;
	align-items: start;
}

.tp-article__main {
	min-width: 0;
	max-width: 720px;
}

/* Share rail */
.tp-share-rail {
	position: sticky;
	top: 96px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.tp-share-rail__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--tp-text-muted);
	border: 1px solid var(--tp-border);
	background: var(--tp-surface-1);
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tp-share-rail__btn:hover,
.tp-share-rail__btn[aria-pressed="true"] {
	color: var(--tp-accent);
	border-color: var(--tp-accent);
	box-shadow: var(--tp-glow);
}

.tp-share-rail__label {
	font-size: 10px;
	color: var(--tp-text-dim);
	writing-mode: vertical-rl;
	letter-spacing: 0.2em;
	margin-bottom: 4px;
	align-self: center;
}

/* Share/copy button: swap share icon for a check while "copied" */
.tp-share-rail__copy .tp-icon-check {
	display: none;
}

.tp-share-rail__copy.is-copied {
	color: var(--tp-accent);
	border-color: var(--tp-accent);
	box-shadow: var(--tp-glow);
}

.tp-share-rail__copy.is-copied .tp-icon-share {
	display: none;
}

.tp-share-rail__copy.is-copied .tp-icon-check {
	display: block;
}

/* Toast notification */
.tp-toast {
	position: fixed;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%) translateY(16px);
	z-index: 200;
	padding: 12px 20px;
	background: var(--tp-surface-1);
	border: 1px solid var(--tp-accent);
	color: var(--tp-text);
	font-family: var(--tp-font-mono);
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	box-shadow: var(--tp-glow);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
	clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.tp-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* Recommended gear sidebar */
.tp-article__aside {
	min-width: 0;
}

.tp-gear {
	position: sticky;
	top: 96px;
	border: 1px solid var(--tp-border);
	background: var(--tp-surface-1);
	padding: 18px;
}

.tp-gear__title {
	color: var(--tp-accent);
	font-size: 12px;
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--tp-border);
}

.tp-gear-card {
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--tp-border);
	align-items: center;
}

.tp-gear-card:hover .tp-gear-card__name {
	color: var(--tp-accent);
}

.tp-gear-card__thumb {
	display: block;
	width: 72px;
	height: 56px;
	border: 1px solid var(--tp-border);
	background: var(--tp-surface-3);
	overflow: hidden;
	position: relative;
}

.tp-gear-card__thumb-ph {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle at 60% 40%, rgba(255, 0, 0, 0.25), transparent 60%),
		repeating-linear-gradient(45deg, var(--tp-surface-2) 0 6px, var(--tp-surface-3) 6px 12px);
}

.tp-gear-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.tp-gear-card__label {
	font-size: 10px;
	color: var(--tp-text-dim);
}

.tp-gear-card__name {
	font-family: var(--tp-font-head);
	font-weight: 700;
	font-size: 14px;
	color: var(--tp-text);
	transition: color 0.2s ease;
}

.tp-gear-card__price {
	font-size: 12px;
	color: var(--tp-accent);
}

.tp-gear__note {
	display: block;
	margin-top: 14px;
	font-size: 10px;
	color: var(--tp-text-dim);
}

/* Static page article (page.php) — single column */
.tp-article__head {
	padding-block: 40px;
}

.tp-article__head--page {
	border-bottom: 1px solid var(--tp-border);
}

.tp-article__body {
	padding-block: 48px;
	max-width: 860px;
}

/* Table of contents */
.tp-toc {
	border: 1px solid var(--tp-border);
	border-left: 2px solid var(--tp-accent);
	background: var(--tp-surface-1);
	padding: 18px 22px;
	margin: 0 0 36px;
}

.tp-toc__title {
	display: block;
	color: var(--tp-accent);
	font-size: 12px;
	margin-bottom: 14px;
}

.tp-toc__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tp-toc__item {
	padding: 7px 0;
	border-bottom: 1px solid var(--tp-border);
}

.tp-toc__item:last-child {
	border-bottom: 0;
}

.tp-toc__item a {
	color: var(--tp-text-muted);
	font-size: 14px;
	display: inline-flex;
	gap: 8px;
}

.tp-toc__item a::before {
	content: "\203A";
	color: var(--tp-accent);
}

.tp-toc__item a:hover {
	color: var(--tp-accent);
}

.tp-toc__item--h3 {
	padding-left: 20px;
}

.tp-toc__item--h3 a {
	font-size: 13px;
	color: var(--tp-text-dim);
}

/* Offset anchor jumps so headings clear the sticky header */
.tp-prose h2,
.tp-prose h3 {
	scroll-margin-top: 90px;
}

/* Related posts ("RELATED_INTEL") */
.tp-related {
	margin: 48px 0;
	padding-top: 24px;
	border-top: 1px solid var(--tp-border);
}

.tp-related__head {
	margin-bottom: 20px;
}

.tp-related__title {
	color: var(--tp-accent);
	font-size: 14px;
	margin: 0;
}

.tp-related__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--tp-gutter);
}

@media (max-width: 900px) {
	.tp-related__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 560px) {
	.tp-related__grid {
		grid-template-columns: 1fr;
	}
}

/* Drop cap on the opening paragraph */
.tp-prose--dropcap > p:first-of-type::first-letter {
	float: left;
	font-family: var(--tp-font-head);
	font-weight: 800;
	font-size: 4.4em;
	line-height: 0.8;
	padding: 6px 12px 0 0;
	color: var(--tp-accent);
	text-shadow: var(--tp-glow);
}

.tp-readout {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 12px;
	margin-top: 16px;
}

.tp-readout__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	background: var(--tp-accent-tint);
	border: 1px solid rgba(255, 0, 0, 0.25);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: var(--tp-text-muted);
}

.tp-readout__key {
	color: var(--tp-accent);
}

/* Prose */
.tp-prose {
	font-size: 18px;
	line-height: 1.75;
	color: var(--tp-text-muted);
}

.tp-prose > * {
	margin-bottom: 1.4em;
}

.tp-prose h2 {
	font-size: 28px;
	text-transform: uppercase;
	color: var(--tp-text);
	margin-top: 1.6em;
	padding-left: 14px;
	border-left: 3px solid var(--tp-accent);
}

.tp-prose h3 {
	font-size: 22px;
	color: var(--tp-text);
	margin-top: 1.4em;
}

.tp-prose a {
	color: var(--tp-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tp-prose blockquote {
	margin: 1.6em 0;
	padding: 18px 22px;
	border-left: 3px solid var(--tp-accent);
	background: var(--tp-surface-1);
	font-style: italic;
}

.tp-prose img,
.tp-prose figure {
	border: 1px solid var(--tp-border);
}

.tp-prose ul,
.tp-prose ol {
	padding-left: 1.4em;
}

.tp-prose li {
	margin-bottom: 0.5em;
}

.tp-prose ul {
	list-style: none;
	padding-left: 0;
}

.tp-prose ul li {
	position: relative;
	padding-left: 22px;
}

.tp-prose ul li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.7em;
	width: 8px;
	height: 8px;
	background: var(--tp-accent);
}

/* Code / "Technical Implementation" blocks */
.tp-prose pre,
.tp-prose code {
	font-family: var(--tp-font-mono);
}

.tp-prose code {
	background: var(--tp-surface-2);
	border: 1px solid var(--tp-border);
	padding: 2px 6px;
	font-size: 0.9em;
	color: var(--tp-accent);
}

.tp-prose pre {
	background: var(--tp-bg-deep);
	border: 1px solid var(--tp-border);
	border-left: 3px solid var(--tp-accent);
	padding: 20px;
	overflow-x: auto;
	font-size: 14px;
	line-height: 1.6;
	position: relative;
}

.tp-prose pre code {
	background: none;
	border: 0;
	padding: 0;
	color: var(--tp-text-muted);
}

/* "System Architecture" style tables inside prose */
.tp-prose table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--tp-font-mono);
	font-size: 14px;
}

.tp-prose th,
.tp-prose td {
	border: 1px solid var(--tp-border);
	padding: 12px 14px;
	text-align: left;
}

.tp-prose thead th {
	background: var(--tp-surface-2);
	color: var(--tp-accent);
	text-transform: uppercase;
}

.tp-article__footer {
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid var(--tp-border);
}

.tp-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tp-pagelinks {
	color: var(--tp-text-dim);
	font-size: 12px;
	margin-top: 20px;
}

.tp-postnav {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--tp-border);
	font-size: 12px;
}

.tp-postnav a {
	color: var(--tp-text-muted);
}

.tp-postnav a:hover {
	color: var(--tp-accent);
}

/* ============================================================
   JOIN_THE_PULSE
   ============================================================ */
.tp-join {
	margin: 48px 0;
	padding: 36px;
	border: 1px solid var(--tp-accent);
	background:
		radial-gradient(circle at 100% 0%, rgba(255, 0, 0, 0.18), transparent 55%),
		var(--tp-surface-1);
	clip-path: polygon(24px 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%, 0 24px);
}

.tp-join__label {
	color: var(--tp-accent);
	font-size: 12px;
}

.tp-join__title {
	font-size: clamp(28px, 4vw, 40px);
	text-transform: uppercase;
	margin: 8px 0 10px;
}

.tp-join__copy {
	color: var(--tp-text-muted);
	max-width: 52ch;
}

.tp-join__form {
	display: flex;
	gap: 12px;
	margin-top: 20px;
	max-width: 560px;
}

.tp-join__form .tp-input {
	flex: 1;
}

.tp-join__note {
	display: block;
	margin-top: 12px;
	font-size: 11px;
	color: var(--tp-text-dim);
}

/* ============================================================
   HUB / FILTERS
   ============================================================ */
.tp-hub__head {
	margin-bottom: 32px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--tp-border);
}

.tp-hub__title {
	font-size: clamp(32px, 6vw, 64px);
	text-transform: uppercase;
	margin: 8px 0 16px;
}

.tp-hub__desc {
	color: var(--tp-text-dim);
	max-width: 70ch;
	margin-bottom: 16px;
}

.tp-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 8px;
}

/* ============================================================
   COMPARISON MATRIX
   ============================================================ */
.tp-comparison__intro {
	max-width: 70ch;
	margin-bottom: 32px;
}

.tp-matrix-wrap {
	overflow-x: auto;
	border: 1px solid var(--tp-border);
}

.tp-matrix {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	min-width: 560px;
}

.tp-matrix th,
.tp-matrix td {
	border: 1px solid var(--tp-border);
	padding: 16px 18px;
	text-align: left;
}

.tp-matrix thead th {
	background: var(--tp-surface-2);
	color: var(--tp-accent);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.tp-matrix tbody th {
	background: var(--tp-surface-1);
	color: var(--tp-text-dim);
	font-weight: 500;
}

.tp-matrix tbody td {
	color: var(--tp-text);
	background: var(--tp-bg-deep);
}

.tp-matrix__score td {
	background: var(--tp-surface-1);
}

.tp-score {
	font-family: var(--tp-font-head);
	font-weight: 800;
	font-size: 20px;
	color: var(--tp-text);
}

.tp-score--win {
	color: var(--tp-accent);
	text-shadow: var(--tp-glow);
}

.tp-datastream {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 20px;
	padding: 16px 20px;
	border: 1px solid var(--tp-accent);
	background: var(--tp-accent-tint);
	font-size: 13px;
}

.tp-datastream__label {
	color: var(--tp-accent);
}

.tp-datastream__val {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.tp-pagination {
	margin-top: 48px;
}

.tp-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.tp-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--tp-border);
	background: var(--tp-surface-1);
	color: var(--tp-text-muted);
	font-size: 13px;
	transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tp-pagination .page-numbers:hover,
.tp-pagination .page-numbers.current {
	border-color: var(--tp-accent);
	color: var(--tp-accent);
	box-shadow: var(--tp-glow);
}

.tp-pagination .page-numbers.current {
	background: var(--tp-accent);
	color: #000;
}

/* ============================================================
   SEARCH FORM
   ============================================================ */
.tp-searchform {
	display: flex;
	gap: 10px;
	margin-top: 16px;
	max-width: 520px;
}

.tp-searchform .tp-input {
	flex: 1;
}

/* ============================================================
   404
   ============================================================ */
.tp-404 {
	text-align: center;
	padding-block: 96px;
}

.tp-404__code {
	color: var(--tp-accent);
	font-size: 14px;
}

.tp-404__title {
	font-size: clamp(48px, 12vw, 120px);
	text-transform: uppercase;
	font-style: italic;
	margin: 12px 0;
	text-shadow: var(--tp-glow);
}

.tp-404__copy {
	color: var(--tp-text-dim);
	margin-bottom: 24px;
}

.tp-404__actions {
	margin-bottom: 28px;
}

.tp-404__search {
	display: flex;
	justify-content: center;
}

.tp-404__search .tp-searchform {
	margin-inline: auto;
}

/* ============================================================
   COMMENTS
   ============================================================ */
.tp-comments {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--tp-border);
}

.tp-comments__title,
.tp-comments__reply {
	color: var(--tp-accent);
	font-size: 15px;
}

.tp-comments__list {
	list-style: none;
	margin: 0 0 32px;
	padding: 0;
}

.tp-comments__list ol.children {
	list-style: none;
	margin-left: 24px;
	padding-left: 16px;
	border-left: 1px solid var(--tp-border);
}

.tp-comments__list li.comment {
	border: 1px solid var(--tp-border);
	background: var(--tp-surface-1);
	padding: 18px;
	margin-bottom: 16px;
}

.tp-comments__list .comment-author {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--tp-font-mono);
	font-size: 13px;
	text-transform: uppercase;
}

.tp-comments__list .comment-author img {
	border: 1px solid var(--tp-border);
}

.tp-comments__list .comment-metadata {
	font-family: var(--tp-font-mono);
	font-size: 11px;
	color: var(--tp-text-dim);
	margin: 6px 0;
}

.tp-comments__list .reply a {
	font-family: var(--tp-font-mono);
	font-size: 11px;
	color: var(--tp-accent);
	text-transform: uppercase;
}

.tp-comments .comment-form label {
	display: block;
	font-family: var(--tp-font-mono);
	font-size: 12px;
	text-transform: uppercase;
	color: var(--tp-text-dim);
	margin-bottom: 6px;
}

.tp-comments .comment-form input[type="text"],
.tp-comments .comment-form input[type="email"],
.tp-comments .comment-form input[type="url"],
.tp-comments .comment-form textarea {
	width: 100%;
	background: var(--tp-bg-deep);
	border: 1px solid var(--tp-border);
	color: var(--tp-text);
	font-family: var(--tp-font-body);
	padding: 12px 14px;
	margin-bottom: 16px;
}

.tp-comments .comment-form input:focus,
.tp-comments .comment-form textarea:focus {
	outline: none;
	border-color: var(--tp-accent);
	box-shadow: var(--tp-glow);
}

.tp-comments__closed {
	color: var(--tp-text-dim);
	font-size: 12px;
}

/* ============================================================
   WIDGETS
   ============================================================ */
.tp-widget {
	margin-bottom: 24px;
}

.tp-widget__title {
	color: var(--tp-accent);
	font-size: 13px;
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--tp-border);
}

.tp-widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tp-widget ul li {
	padding: 8px 0;
	border-bottom: 1px solid var(--tp-border);
	font-size: 14px;
}

.tp-widget ul li a {
	color: var(--tp-text-muted);
}

.tp-widget ul li a:hover {
	color: var(--tp-accent);
}

/* ============================================================
   FOOTER
   ============================================================ */
.tp-footer {
	margin-top: 64px;
	border-top: 1px solid var(--tp-border);
	background: var(--tp-bg-deep);
}

.tp-footer__inner {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 40px;
	padding-block: 48px;
}

.tp-footer__tagline {
	color: var(--tp-text-dim);
	font-size: 12px;
	margin-top: 12px;
}

.tp-footer__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
}

.tp-footer__menu li {
	padding: 6px 0;
}

.tp-footer__menu a {
	color: var(--tp-text-muted);
}

.tp-footer__bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	padding: 18px var(--tp-margin);
	border-top: 1px solid var(--tp-border);
	font-size: 11px;
	color: var(--tp-text-dim);
	max-width: var(--tp-maxw);
	margin-inline: auto;
	width: 100%;
}

/* ============================================================
   WP CORE ALIGNMENT / CAPTION HELPERS
   ============================================================ */
.alignleft {
	float: left;
	margin: 0 24px 16px 0;
}
.alignright {
	float: right;
	margin: 0 0 16px 24px;
}
.aligncenter {
	display: block;
	margin-inline: auto;
}
.wp-caption-text,
.tp-prose figcaption {
	font-family: var(--tp-font-mono);
	font-size: 12px;
	color: var(--tp-text-dim);
	padding: 8px 0;
	text-transform: uppercase;
}
.sticky,
.bypostauthor {
	/* hooks for WP; no visual change required */
}

/* ============================================================
   RESPONSIVE — TABLET (<= 1024px)
   ============================================================ */
@media (max-width: 1024px) {
	:root {
		--tp-margin: 32px;
	}

	.tp-grid--cards {
		grid-template-columns: repeat(2, 1fr);
	}

	.tp-hero__inner {
		grid-template-columns: 1fr;
		gap: 32px;
		padding-block: 48px;
	}

	.tp-hero__media {
		order: -1;
	}

	.tp-layout {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.tp-trackers {
		grid-template-columns: repeat(2, 1fr);
	}

	.tp-footer__inner {
		grid-template-columns: 1fr 1fr;
	}

	/* Article: drop the third column, keep share rail + body */
	.tp-article__layout {
		grid-template-columns: 48px minmax(0, 1fr);
	}

	.tp-article__main {
		max-width: none;
	}

	.tp-article__aside {
		grid-column: 1 / -1;
	}

	.tp-gear {
		position: static;
	}

	.tp-gear .tp-gear-card {
		display: grid;
	}
}

/* ============================================================
   RESPONSIVE — MOBILE (<= 640px)
   ============================================================ */
@media (max-width: 640px) {
	:root {
		--tp-margin: 20px;
		--tp-gutter: 16px;
	}

	body {
		font-size: 15px;
	}

	/* Nav collapses to toggle */
	.tp-nav-toggle {
		display: flex;
	}

	.tp-nav {
		position: fixed;
		inset: 64px 0 auto 0;
		flex-direction: column;
		align-items: flex-start;
		gap: 0;
		background: rgba(19, 19, 19, 0.96);
		backdrop-filter: blur(12px);
		-webkit-backdrop-filter: blur(12px);
		border-bottom: 1px solid var(--tp-border);
		padding: 16px var(--tp-margin) 24px;
		transform: translateY(-120%);
		opacity: 0;
		pointer-events: none;
		transition: transform 0.3s ease, opacity 0.3s ease;
		max-height: calc(100vh - 64px);
		overflow-y: auto;
	}

	.tp-nav.is-open {
		transform: translateY(0);
		opacity: 1;
		pointer-events: auto;
	}

	.tp-menu {
		flex-direction: column;
		align-items: flex-start;
		gap: 0;
		width: 100%;
		font-size: 15px;
	}

	.tp-menu li {
		width: 100%;
		border-bottom: 1px solid var(--tp-border);
	}

	.tp-menu a {
		display: block;
		padding: 14px 0;
	}

	.tp-menu ul.sub-menu {
		position: static;
		display: block;
		border: 0;
		margin: 0 0 8px;
		padding: 0 0 0 16px;
		background: transparent;
	}

	.tp-status {
		margin-top: 16px;
	}

	.tp-grid--cards {
		grid-template-columns: 1fr;
	}

	.tp-trackers {
		grid-template-columns: 1fr;
	}

	.tp-hero__title {
		font-size: clamp(30px, 10vw, 40px);
	}

	.tp-hero__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.tp-hero__actions .tp-btn {
		justify-content: center;
	}

	.tp-join {
		padding: 24px;
	}

	.tp-join__form,
	.tp-searchform {
		flex-direction: column;
	}

	.tp-footer__inner {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.tp-footer__bar {
		flex-direction: column;
		text-align: left;
	}

	.tp-article__body {
		padding-block: 32px;
	}

	.tp-prose {
		font-size: 16px;
	}

	/* Article: single column, share rail becomes a horizontal bar */
	.tp-article__layout {
		grid-template-columns: 1fr;
		gap: 28px;
		padding-block: 32px;
	}

	.tp-share-rail {
		position: static;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 10px;
		align-items: center;
	}

	.tp-share-rail__label {
		writing-mode: horizontal-tb;
		margin: 0 4px 0 0;
	}

	.tp-article__hero-media {
		height: clamp(280px, 52vh, 420px);
	}

	.tp-article__hero-readout {
		gap: 14px;
		row-gap: 8px;
	}

	.tp-prose--dropcap > p:first-of-type::first-letter {
		font-size: 3.4em;
	}
}

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