/* Trap Flag Labs: details that theme.json can't express. */

:root {
	--tfl-accent: var(--wp--preset--color--accent, #F95E02);
	--tfl-accent-dim: rgba(249, 94, 2, 0.14);
	--tfl-line: var(--wp--preset--color--line, #262626);
	--tfl-line-strong: var(--wp--preset--color--line-strong, #3A3A3A);
	--tfl-muted: var(--wp--preset--color--muted, #9A9A9A);
	--tfl-faint: var(--wp--preset--color--faint, #5E5E5E);
	--tfl-mono: var(--wp--preset--font-family--plex-mono, monospace);
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--tfl-accent); color: #0B0B0B; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--tfl-accent); outline-offset: 3px; }
code, kbd, samp { font-family: var(--tfl-mono); }
:where(p, li) > code { font-size: 0.92em; color: var(--wp--preset--color--contrast); background: #141414; border: 1px solid var(--tfl-line); padding: 0.05em 0.35em; }

/* Content links: underline thin and offset */
.entry-content a:not(.wp-element-button), .wp-block-post-content a:not(.wp-element-button) { text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- Header ---------- */
.wp-site-blocks > header.wp-block-template-part,
.wp-site-blocks > .wp-block-template-part:first-child:has(.tfl-header) {
	position: sticky; top: 0; z-index: 50;
}
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; } }
.tfl-header {
	background: rgba(11, 11, 11, 0.85);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--tfl-line);
}
.tfl-header__inner { min-height: var(--wp--custom--header-height, 64px); }
.tfl-header .wp-block-site-logo img { height: auto; }
.tfl-header .wp-block-navigation__responsive-container.is-menu-open { padding: 2rem; }
.tfl-header .wp-block-button__link { padding: 0.5rem 0.9rem; font-size: var(--wp--preset--font-size--x-small); white-space: nowrap; }
.tfl-header .wp-block-navigation-item__content:hover { color: var(--tfl-accent); }
.tfl-header .current-menu-item > .wp-block-navigation-item__content { color: var(--wp--preset--color--contrast); }

/* ---------- Footer ---------- */
.tfl-footer { border-top: 1px solid var(--tfl-line); }
.tfl-footer a { text-decoration: none; color: var(--tfl-muted); }
.tfl-footer a:hover { color: var(--tfl-accent); }

/* ---------- Block styles ---------- */

/* Heading: shell prompt */
.is-style-shell-prompt {
	font-family: var(--tfl-mono) !important;
	font-weight: 500 !important;
	letter-spacing: -0.02em;
}
.is-style-shell-prompt::before { content: "$ "; color: var(--tfl-accent); }

/* Heading: hex index ("0x10  Section") uses a <mark> or leading <code> for the index */
.is-style-hex-index code,
.is-style-hex-index mark {
	font-family: var(--tfl-mono); font-weight: 400; font-size: var(--wp--preset--font-size--small);
	color: var(--tfl-accent) !important; background: none !important; border: 0; padding: 0;
	margin-right: 1rem; vertical-align: 0.35em; letter-spacing: 0;
}

/* Paragraph: mono label */
.is-style-mono-label {
	font-family: var(--tfl-mono);
	font-size: var(--wp--preset--font-size--x-small) !important;
	text-transform: uppercase; letter-spacing: 0.08em;
	color: var(--tfl-accent);
}
/* Paragraph: lede */
.is-style-lede {
	font-size: var(--wp--preset--font-size--x-large) !important;
	font-weight: 500; line-height: 1.15; letter-spacing: -0.015em;
	color: var(--wp--preset--color--contrast);
}
/* Paragraph: status chip with blinking LED */
.is-style-status {
	display: inline-flex !important; align-items: center; gap: 0.6rem;
	font-family: var(--tfl-mono); font-size: var(--wp--preset--font-size--x-small) !important;
	color: var(--tfl-muted); border: 1px solid var(--tfl-line); padding: 0.4rem 0.75rem;
	background: var(--wp--preset--color--base);
}
.is-style-status::before {
	content: ""; width: 7px; height: 7px; background: var(--tfl-accent);
	box-shadow: 0 0 10px var(--tfl-accent); animation: tfl-blink 1.6s steps(2, start) infinite;
}
@keyframes tfl-blink { 50% { opacity: 0.25; } }

/* Group: panel */
.wp-block-group.is-style-panel { border: 1px solid var(--tfl-line-strong); background: var(--wp--preset--color--base); padding: 1.75rem 1.5rem; }
.wp-block-group.is-style-panel.tfl-hot { border-color: var(--tfl-accent); background: linear-gradient(180deg, rgba(249,94,2,.07), transparent 60%); }

/* Group + code: terminal window */
.wp-block-group.is-style-terminal,
.wp-block-code.is-style-terminal {
	position: relative; background: var(--wp--preset--color--terminal, #070707);
	border: 1px solid var(--tfl-line-strong);
	box-shadow: 0 30px 80px -40px rgba(249, 94, 2, 0.3);
	padding-top: 3rem !important;
}
.wp-block-group.is-style-terminal { padding: 3rem 1.1rem 1rem; font-family: var(--tfl-mono); font-size: 0.8125rem; }
.wp-block-group.is-style-terminal::before,
.wp-block-code.is-style-terminal::before {
	content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2.1rem;
	border-bottom: 1px solid var(--tfl-line);
	background:
		linear-gradient(var(--tfl-line-strong), var(--tfl-line-strong)) 0.75rem 50% / 9px 1px no-repeat;
}
.wp-block-group.is-style-terminal::after,
.wp-block-code.is-style-terminal::after {
	content: ""; position: absolute; top: calc(1.05rem - 5px); left: 0.75rem; width: 9px; height: 9px;
	border: 1px solid var(--tfl-line-strong);
	box-shadow: 14px 0 0 -1px var(--wp--preset--color--terminal, #070707), 14px 0 0 0 var(--tfl-line-strong),
	            28px 0 0 -1px var(--wp--preset--color--terminal, #070707), 28px 0 0 0 var(--tfl-line-strong);
}
.wp-block-group.is-style-terminal::before, .wp-block-code.is-style-terminal::before { background: none; }

/* Group: dotted grid background (hero) */
.wp-block-group.is-style-grid-bg { position: relative; isolation: isolate; }
.wp-block-group.is-style-grid-bg::before {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background-image: linear-gradient(var(--tfl-line) 1px, transparent 1px), linear-gradient(90deg, var(--tfl-line) 1px, transparent 1px);
	background-size: 56px 56px; opacity: 0.28;
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
	        mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

/* List: chevrons */
.wp-block-list.is-style-chevron { list-style: none; padding-left: 0; }
.wp-block-list.is-style-chevron li { position: relative; padding-left: 1.3rem; }
.wp-block-list.is-style-chevron li + li { margin-top: 0.5rem; }
.wp-block-list.is-style-chevron li::before { content: "›"; position: absolute; left: 0; color: var(--tfl-accent); font-family: var(--tfl-mono); }

/* List: tag chips */
.wp-block-list.is-style-tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.wp-block-list.is-style-tags li { margin: 0; font-family: var(--tfl-mono); font-size: var(--wp--preset--font-size--x-small); color: var(--tfl-muted); border: 1px solid var(--tfl-line-strong); padding: 0.1rem 0.5rem; white-space: nowrap; }

/* Image: hairline */
.wp-block-image.is-style-hairline img { border: 1px solid var(--tfl-line); }

/* Outline button hover */
.wp-block-button.is-style-outline > .wp-block-button__link:hover { border-color: var(--tfl-accent); color: var(--tfl-accent); background: transparent; }

/* ---------- Pattern components ---------- */

/* Section rule */
.tfl-section { border-top: 1px solid var(--tfl-line); }

/* Ring stack (capabilities sorted by privilege) */
.tfl-ring-stack { border-top: 1px solid var(--tfl-line); }
.tfl-ring-row {
	display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) minmax(0, 16rem);
	gap: clamp(1rem, 3vw, 2.5rem); align-items: start;
	padding: 1.75rem 0; border-bottom: 1px solid var(--tfl-line); position: relative;
}
.tfl-ring-row > * { margin: 0 !important; }
.tfl-ring-row::before { content: ""; position: absolute; left: -1rem; top: 0; bottom: 0; width: 2px; background: var(--tfl-accent); transform: scaleY(0); transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.tfl-ring-row:hover::before { transform: scaleY(1); }
.tfl-ring-row .tfl-ring { font-family: var(--tfl-mono); font-size: var(--wp--preset--font-size--small); color: var(--tfl-muted); padding-top: 0.15rem; }
.tfl-ring-row.tfl-hot .tfl-ring { color: var(--tfl-accent); }
.tfl-ring-row h3 { margin: 0 0 0.35rem; }
.tfl-ring-row .tfl-ring-body > p { color: var(--tfl-muted); margin: 0; }
.tfl-ring-row .wp-block-list.is-style-tags { justify-content: flex-end; }
@media (max-width: 820px) {
	.tfl-ring-row { grid-template-columns: 1fr; gap: 0.5rem; }
	.tfl-ring-row .wp-block-list.is-style-tags { justify-content: flex-start; }
}

/* Method steps */
.tfl-steps { gap: 0 !important; border-top: 1px solid var(--tfl-line); border-left: 1px solid var(--tfl-line); }
.tfl-steps > .wp-block-column { padding: 1.75rem 1.5rem 2rem; border-right: 1px solid var(--tfl-line); border-bottom: 1px solid var(--tfl-line); transition: background .2s; margin: 0 !important; }
.tfl-steps > .wp-block-column:hover { background: var(--wp--preset--color--surface); }
.tfl-steps .is-style-mono-label { margin-bottom: 2.5rem; }
.tfl-steps p:not(.is-style-mono-label) { color: var(--tfl-muted); font-size: var(--wp--preset--font-size--small); }

/* Pull rule */
.tfl-pull p { font-size: var(--wp--preset--font-size--xx-large); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; max-width: 17ch; }
.tfl-pull p::before { content: ""; display: block; width: 3.5rem; height: 4px; background: var(--tfl-accent); margin-bottom: 1.5rem; }
.tfl-pull .tfl-cite { font-family: var(--tfl-mono); font-size: var(--wp--preset--font-size--small); color: var(--tfl-muted); font-weight: 400; letter-spacing: 0; }
.tfl-pull .tfl-cite::before { display: none; }

/* Engagement list (INT vectors) */
.tfl-vectors { border-top: 1px solid var(--tfl-line); }
.tfl-vector { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.25rem; padding: 1.4rem 0; border-bottom: 1px solid var(--tfl-line); }
.tfl-vector > * { margin: 0 !important; }
.tfl-vector .tfl-vec { font-family: var(--tfl-mono); font-size: var(--wp--preset--font-size--x-small); color: var(--tfl-accent); padding-top: 0.25rem; }
.tfl-vector h3 { font-size: var(--wp--preset--font-size--medium); margin: 0 0 0.25rem; }
.tfl-vector p { color: var(--tfl-muted); font-size: var(--wp--preset--font-size--small); margin: 0; }

/* Lab log (dmesg-style post list) */
.tfl-dmesg .wp-block-post-template { border-top: 1px solid var(--tfl-line); margin: 0; padding: 0; list-style: none; }
.tfl-dmesg .wp-block-post { margin: 0 !important; }
.tfl-dmesg__row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.25rem 1.25rem; padding: 1.1rem 0; border-bottom: 1px solid var(--tfl-line); transition: background .15s; align-items: baseline; }
.tfl-dmesg__row > * { margin: 0 !important; }
.tfl-dmesg__row:hover { background: var(--wp--preset--color--surface); }
.tfl-dmesg__row .wp-block-post-date::before { content: "["; color: var(--tfl-faint); }
.tfl-dmesg__row .wp-block-post-date::after { content: "]"; color: var(--tfl-faint); }
.tfl-dmesg__row .wp-block-post-title { font-size: var(--wp--preset--font-size--medium); font-weight: 500; letter-spacing: 0; line-height: 1.4; }
.tfl-dmesg__row .wp-block-post-excerpt { grid-column: 2; }
.tfl-dmesg__row .wp-block-post-excerpt__excerpt { margin: 0; }
.tfl-dmesg__row .wp-block-post-excerpt__more-text { display: none; }
@media (max-width: 700px) { .tfl-dmesg__row { grid-template-columns: 1fr; } .tfl-dmesg__row .wp-block-post-excerpt { grid-column: auto; } }

/* Single post */
.tfl-post-meta { font-family: var(--tfl-mono); font-size: var(--wp--preset--font-size--x-small); color: var(--tfl-faint); }
.tfl-post-meta > * + *::before { content: "·"; margin-right: 1rem; color: var(--tfl-line-strong); }
.tfl-post-head { border-bottom: 1px solid var(--tfl-line); }
.wp-block-post-content h2 { padding-top: 1.5rem; border-top: 1px solid var(--tfl-line); margin-top: 3rem; }
.wp-block-post-content > .wp-block-code, .wp-block-post-content > .wp-block-preformatted { overflow-x: auto; }
.wp-block-post-navigation-link a { text-decoration: none; font-family: var(--tfl-mono); font-size: var(--wp--preset--font-size--small); }

/* Comments */
.wp-block-comments .wp-block-comment-template { border-top: 1px solid var(--tfl-line); padding-left: 0; }
.wp-block-comments .wp-block-comment-template li { border-bottom: 1px solid var(--tfl-line); padding: 1.25rem 0; list-style: none; }
.wp-block-comment-author-name, .wp-block-comment-date { font-family: var(--tfl-mono); font-size: var(--wp--preset--font-size--x-small); }
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]), .wp-block-post-comments-form textarea,
.wp-block-search__input {
	background: var(--wp--preset--color--terminal, #070707); color: var(--wp--preset--color--contrast);
	border: 1px solid var(--tfl-line-strong); border-radius: 0; font-family: var(--tfl-mono); padding: 0.7rem 0.8rem;
}
.wp-block-post-comments-form input:focus, .wp-block-post-comments-form textarea:focus, .wp-block-search__input:focus { border-color: var(--tfl-accent); outline: none; }
.wp-block-search__button { margin-left: 0.5rem; }

/* Tables */
.wp-block-table table { border-collapse: collapse; }
.wp-block-table th, .wp-block-table td { border: 1px solid var(--tfl-line) !important; padding: 0.6rem 0.8rem; }
.wp-block-table thead { border-bottom: 1px solid var(--tfl-accent) !important; }
.wp-block-table th { color: var(--tfl-accent); font-weight: 500; text-align: left; }

/* Separator */
.wp-block-separator { border-top: 1px solid var(--tfl-line) !important; border-bottom: 0 !important; opacity: 1; }

/* Hero */
.tfl-hero-logo img { width: 100%; height: auto; }
.tfl-hero-split { border-top: 1px solid var(--tfl-line); }
.tfl-hero-split p:not(.is-style-lede) { color: var(--tfl-muted); }

/* Full-bleed image with fades */
.tfl-bleed { position: relative; overflow: hidden; }
.tfl-bleed img { width: 100%; height: clamp(260px, 44vw, 600px); object-fit: cover; display: block; }
.tfl-bleed::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, var(--wp--preset--color--base) 0%, transparent 22%, transparent 70%, var(--wp--preset--color--base) 100%); }
.tfl-bleed figcaption { position: absolute; left: clamp(1.25rem, 4vw, 3rem); bottom: 1.5rem; z-index: 1; margin: 0; text-align: left; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Layout rhythm ---------- */
.tfl-front { padding-top: 0 !important; padding-bottom: 0 !important; }
.tfl-front > * { margin-block-start: 0 !important; }
.tfl-hero { padding-top: clamp(3rem, 8vw, 6rem); padding-bottom: var(--wp--preset--spacing--70); overflow: hidden; }
.tfl-hero .is-style-status { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.tfl-hero-logo { max-width: 1000px; margin: 0 auto clamp(2.5rem, 6vw, 4.5rem) !important; }
.tfl-hero-split { padding-top: clamp(1.75rem, 4vw, 2.5rem); gap: clamp(1.5rem, 5vw, 4rem) !important; }
.tfl-lede { font-size: var(--wp--preset--font-size--x-large) !important; font-weight: 500 !important; line-height: 1.15 !important; letter-spacing: -0.015em; max-width: 18ch; margin: 0; }
.tfl-section { padding-top: var(--wp--preset--spacing--70); padding-bottom: var(--wp--preset--spacing--70); }
.tfl-section .is-style-hex-index, .tfl-section .is-style-shell-prompt { margin-bottom: 1.5rem; }
.tfl-intro { color: var(--tfl-muted); max-width: 62ch; margin-bottom: clamp(2.5rem, 5vw, 4rem) !important; }
.tfl-main { padding-top: clamp(3rem, 7vw, 5rem); padding-bottom: var(--wp--preset--spacing--70); }
.tfl-page-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.tfl-page-head .is-style-shell-prompt { font-size: var(--wp--preset--font-size--x-large); }
.tfl-post-head { padding-bottom: clamp(2rem, 4vw, 3rem); }
.tfl-post-title { max-width: 20ch; }
.tfl-dek { font-size: var(--wp--preset--font-size--large); max-width: 56ch; }
.tfl-dek .wp-block-post-excerpt__excerpt { color: var(--tfl-muted); }
.tfl-prose { margin-top: clamp(2rem, 4vw, 3rem) !important; }
.tfl-post-nav { border-top: 1px solid var(--tfl-line); margin-top: 3rem !important; padding-top: 1.5rem; }
.tfl-comments { margin-top: 3rem !important; }
.tfl-pagination { margin-top: 2rem !important; font-family: var(--tfl-mono); }
.tfl-pagination a { text-decoration: none; }
.tfl-footer { padding-top: 2rem; padding-bottom: 2.5rem; }
.tfl-footer-note { font-family: var(--tfl-mono); font-size: var(--wp--preset--font-size--x-small); color: var(--tfl-muted); margin: 0; }
.tfl-footer-logo img { opacity: 0.85; }
.tfl-small-mono { font-family: var(--tfl-mono); font-size: var(--wp--preset--font-size--x-small); color: var(--tfl-muted); margin-top: 1.5rem !important; }
.tfl-btn-mono .wp-block-button__link { font-family: var(--tfl-mono); font-size: clamp(1rem, 0.9rem + 0.6vw, 1.375rem); padding: 1rem 1.5rem; word-break: break-all; }
.tfl-pull { margin-top: clamp(3.5rem, 8vw, 6rem) !important; }
.tfl-front > .tfl-bleed { margin-top: 0 !important; border-top: 1px solid var(--tfl-line); }
@media (max-width: 781px) { .tfl-steps > .wp-block-column { flex-basis: 100% !important; } }
@media (min-width: 600px) and (max-width: 960px) { .tfl-steps { flex-wrap: wrap !important; } .tfl-steps > .wp-block-column { flex-basis: 50% !important; } }
.wp-block-quote cite { display: block; margin-top: 0.75rem; font-size: var(--wp--preset--font-size--x-small); color: var(--tfl-muted); font-family: var(--tfl-mono); }
.wp-block-quote cite::before { content: "— "; }

/* Contact band */
.tfl-cta-band { border-top: 1px solid var(--tfl-line); padding-top: var(--wp--preset--spacing--60); padding-bottom: var(--wp--preset--spacing--60); background: linear-gradient(180deg, rgba(249,94,2,.06), transparent 75%); }
.tfl-cta-band__inner { gap: 1.5rem 3rem !important; }
.tfl-cta-band .is-style-mono-label { margin: 0 0 0.6rem; }
.tfl-cta-band__title { font-size: var(--wp--preset--font-size--x-large); max-width: 22ch; margin: 0; }
.tfl-cta-band .tfl-btn-mono .wp-block-button__link { font-size: var(--wp--preset--font-size--medium); padding: 0.85rem 1.25rem; }
.tfl-main + .tfl-cta-band, .wp-site-blocks > .tfl-cta-band { margin-top: 0; }
.tfl-cta-band .is-style-mono-label { text-transform: none; }
