/*
Theme Name: itsdark
Theme URI: https://itsdark.io/
Description: The itsdark.io theme. Guides are arranged by depth, from the surface to the abyss: the homepage is a descent chart, and each guide carries a depth gauge that sinks as you read. Includes the Signal, Lantern and Myth Meter boxes, a contents list, the Sonar Index status board, and self-hosted fonts with no third-party requests.
Version: 1.2.2
Requires at least: 6.4
Requires PHP: 8.1
Author: itsdark.io
License: GPL-2.0-or-later
Text Domain: itsdark
*/

/* ------------------------------------------------------------ fonts (self-hosted, SIL OFL) */
@font-face { font-family: "Bricolage Grotesque"; src: url("assets/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("assets/fonts/literata.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("assets/fonts/literata-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

/* ------------------------------------------------------------ tokens */
:root {
	/* water, from the surface down */
	--dusk: #1f4078;
	--surface: #16305e;
	--twilight: #0f2147;
	--midnight: #091530;
	--abyss: #04070f;

	--ink: #e9edf5;
	--muted: #9dabc4;
	--rule: rgba(157, 171, 196, 0.2);
	--raise: rgba(233, 237, 245, 0.045);

	--lantern: #f2b134;        /* guidance: links, boxes, buttons */
	--lantern-pale: #ffd98a;
	--sonar: #5fe0c2;          /* measured data: live status, the gauge */
	--down: #ff8364;

	--display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
	--text: "Literata", Georgia, "Times New Roman", serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

	--wide: 1180px;
	--measure: 44rem;
	--p: 0; /* scroll progress, 0 to 1, set by site.js on guides */
	color-scheme: dark;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
body {
	margin: 0;
	font: 400 1.125rem/1.72 var(--text);
	color: var(--ink);
	background: var(--abyss);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	position: relative;
}
/* Water above the page: lighter near the top, gone by the time you have scrolled a screen or two. */
body::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 1100px;
	max-height: 100%;
	background: linear-gradient(180deg, var(--surface) 0, var(--midnight) 55%, rgba(4, 7, 15, 0) 100%);
	z-index: -1;
	pointer-events: none;
}
/* On a guide the water fills the window and darkens as you read down. */
body.has-descent::before {
	position: fixed;
	inset: 0;
	height: auto;
	background: linear-gradient(180deg, var(--water-top, var(--surface)) 0, var(--water-bottom, var(--midnight)) 100%);
	opacity: calc(1 - var(--p) * 0.94);
}
body.zone-surface { --water-top: #1b3a70; --water-bottom: #0d1d40; }
body.zone-twilight { --water-top: #142a57; --water-bottom: #0a1733; }
body.zone-midnight { --water-top: #0d1b3c; --water-bottom: #070e22; }
body.zone-abyss { --water-top: #091226; --water-bottom: #04070f; }

img, svg, video { max-width: 100%; height: auto; }
a { color: var(--lantern-pale); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--lantern); }
:focus-visible { outline: 2px solid var(--lantern); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--lantern); color: #10131c; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.12; letter-spacing: -0.018em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 1.3rem + 3.6vw, 3.7rem); font-weight: 800; letter-spacing: -0.03em; }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 16px; top: 16px; z-index: 100; background: var(--lantern); color: #10131c; padding: 8px 14px; border-radius: 4px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: 24px; }
main { flex: 1; }

.button {
	display: inline-block;
	font: 600 0.95rem/1 var(--display);
	padding: 0.8em 1.15em;
	border-radius: 6px;
	border: 1px solid var(--lantern);
	background: var(--lantern);
	color: #10131c;
	text-decoration: none;
}
.button:hover { background: var(--lantern-pale); border-color: var(--lantern-pale); color: #10131c; }
.button--quiet { background: transparent; color: var(--lantern-pale); border-color: rgba(242, 177, 52, 0.45); }
.button--quiet:hover { background: rgba(242, 177, 52, 0.12); color: var(--lantern-pale); }

/* ------------------------------------------------------------ header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(6, 12, 28, 0.82);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; flex: none; text-decoration: none; }
.brand img { height: 36px; width: auto; display: block; }
.brand-text { font: 800 1.45rem/1 var(--display); letter-spacing: -0.03em; color: var(--ink); }
.brand-text span { color: var(--lantern); }

.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.primary-nav a {
	display: block;
	font: 500 0.9rem/1 var(--display);
	color: var(--muted);
	text-decoration: none;
	padding: 0.65em 0.7em;
	border-radius: 6px;
	white-space: nowrap;
}
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-menu-parent > a { color: var(--ink); background: var(--raise); }
.primary-nav .is-sonar { margin-left: 8px; }
.primary-nav .is-sonar > a { color: var(--ink); border: 1px solid rgba(95, 224, 194, 0.4); padding-left: 0.75em; }
.primary-nav .is-sonar > a::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--sonar); margin-right: 0.55em; vertical-align: 0.08em; }
.primary-nav .is-sonar > a:hover { background: rgba(95, 224, 194, 0.1); }

.nav-toggle { display: none; font: 600 0.9rem/1 var(--display); color: var(--ink); background: transparent; border: 1px solid var(--rule); border-radius: 6px; padding: 0.7em 1em; cursor: pointer; }

@media (max-width: 1099px) {
	.nav-toggle { display: block; }
	.primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #060c1c; border-bottom: 1px solid var(--rule); padding: 8px 16px 16px; }
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
	.primary-nav a { font-size: 1.05rem; padding: 0.85em 0.5em; border-radius: 0; border-bottom: 1px solid var(--rule); }
	.primary-nav .is-sonar { margin: 12px 0 0; }
	.primary-nav .is-sonar > a { border-radius: 6px; }
}

/* ------------------------------------------------------------ home: hero */
.hero { background: linear-gradient(180deg, var(--dusk) 0, var(--surface) 100%); padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 80px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 23rem; gap: clamp(32px, 6vw, 88px); align-items: end; }
.hero h1 { font-size: clamp(2.9rem, 1.2rem + 7vw, 6.4rem); line-height: 0.96; letter-spacing: -0.045em; max-width: 9em; }
.hero .lede { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem); line-height: 1.55; max-width: 34em; margin: 1.3em 0 0; color: #dbe3f2; }
.hero-note { font: 500 1rem/1.5 var(--display); color: var(--lantern-pale); margin: 1.6em 0 0; }
@media (max-width: 899px) { .hero-grid { grid-template-columns: 1fr; align-items: start; } }

/* ------------------------------------------------------------ Sonar status panel */
.sonar-panel { border: 1px solid rgba(95, 224, 194, 0.32); border-radius: 10px; background: rgba(4, 9, 22, 0.55); padding: 22px 24px 24px; font-family: var(--display); }
.sonar-panel-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.ping { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--sonar); flex: none; }
.ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--sonar); animation: ping 2.6s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: 0.9; } to { transform: scale(3.6); opacity: 0; } }
.sonar-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0; }
.sonar-figures div { display: flex; flex-direction: column-reverse; }
.sonar-figures dt { font-size: 0.85rem; line-height: 1.3; color: var(--muted); }
.sonar-figures dd { margin: 0; font-size: 2.9rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--sonar); }
.sonar-panel-note { font-size: 0.9rem; line-height: 1.45; color: var(--muted); margin: 16px 0 0; }
.sonar-panel-note strong { display: block; color: var(--lantern-pale); font-weight: 600; margin-top: 4px; }
.sonar-panel-link { margin: 18px 0 0; }
.sonar-panel.is-stale { border-color: rgba(242, 177, 52, 0.45); }
.sonar-panel.is-stale .ping { background: var(--lantern); }
.sonar-panel.is-stale .ping::after { display: none; }
.sonar-panel.is-stale .sonar-figures dd { color: var(--ink); }

/* ------------------------------------------------------------ home: the descent */
.zone { border-top: 1px solid rgba(233, 237, 245, 0.1); }
.zone--surface { background: var(--surface); }
.zone--twilight { background: var(--twilight); }
.zone--midnight { background: var(--midnight); }
.zone--abyss { background: var(--abyss); }
.zone-grid { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); }
.zone-head, .zone-posts { padding-block: clamp(36px, 5vw, 64px); }
/* the gauge line runs down the left edge of every zone, with a tick where each one starts */
.zone-head { border-left: 1px solid rgba(95, 224, 194, 0.35); padding-left: 28px; position: relative; }
.zone-head::before { content: ""; position: absolute; left: 0; top: 0; width: 18px; height: 1px; background: var(--sonar); }
.zone-depth { font: 800 clamp(2.6rem, 1.6rem + 3vw, 4.2rem)/0.95 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--sonar); margin: 0 0 0.35em; }
.zone-head h2 { font-size: 1.55rem; }
.zone-name { font: 500 0.95rem/1.3 var(--display); color: var(--muted); margin: 0.35em 0 0; }
.zone-blurb { font-size: 1rem; line-height: 1.55; color: #c9d3e6; margin: 1em 0 0; max-width: 22em; }
.zone-posts ul { list-style: none; margin: 0; padding: 0; }
.zone-posts li { padding: 0.95em 0; border-bottom: 1px solid var(--rule); }
.zone-posts li:first-child { padding-top: 0; }
.zone-posts li > a { display: block; font: 600 clamp(1.15rem, 1rem + 0.55vw, 1.4rem)/1.25 var(--display); letter-spacing: -0.012em; color: var(--ink); text-decoration: none; }
.zone-posts li > a:hover { color: var(--lantern-pale); text-decoration: underline; }
.zone-post-meta { display: block; font: 400 0.88rem/1.4 var(--display); color: var(--muted); margin-top: 0.3em; }
.zone-more { font: 600 0.95rem/1.4 var(--display); margin: 1.2em 0 0; }
.zone-empty { font-style: italic; color: var(--muted); margin: 0; }
@media (max-width: 799px) {
	.zone-grid { grid-template-columns: 1fr; gap: 0; }
	.zone-head { padding-bottom: 20px; }
	.zone-posts { padding-top: 0; padding-left: 29px; border-left: 1px solid rgba(95, 224, 194, 0.35); }
}
.hero h1 .hero-sub { display: block; font-size: clamp(1.25rem, 1rem + 1.1vw, 1.9rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; color: var(--lantern-pale); margin-top: 0.7em; }
.home-about { border-top: 1px solid rgba(233, 237, 245, 0.1); padding-block: clamp(44px, 6vw, 80px); }
.home-about h2 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); max-width: 22em; }
.home-about-text { max-width: 44rem; margin-top: 1.1em; font-size: 1.08rem; line-height: 1.7; color: #d3dcec; }
.home-about-text p { margin: 0 0 1em; }
/* wide screens: heading beside the text, on the same columns as the depth zones */
@media (min-width: 900px) {
	.home-about .wrap { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
	.home-about h2 { font-size: clamp(1.6rem, 1.2rem + 1vw, 2rem); max-width: none; }
	.home-about-text { max-width: none; margin-top: 0.2em; }
}
.home-about-text p:last-child { margin-bottom: 0; }
.more-guides { padding-block: 56px; }
.more-guides > h2 { font-size: 1.7rem; margin-bottom: 0.6em; }

/* ------------------------------------------------------------ lists of guides */
.archive-head { padding: clamp(40px, 7vw, 88px) 0 clamp(24px, 4vw, 40px); max-width: 46rem; }
.archive-head .zone-depth { margin-bottom: 0.2em; }
.archive-head .desc { font-size: 1.2rem; line-height: 1.6; color: #d3dcec; margin-top: 1em; }
.archive-head .desc p { margin: 0; }
.cards { list-style: none; margin: 0 0 56px; padding: 0; max-width: 46rem; }
.card { padding: 1.5em 0; border-top: 1px solid var(--rule); }
.card-title { font-size: clamp(1.3rem, 1.1rem + 0.7vw, 1.6rem); line-height: 1.2; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--lantern-pale); text-decoration: underline; }
.card-excerpt { margin: 0.55em 0 0; font-size: 1.02rem; line-height: 1.6; color: #c9d3e6; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; margin: 0.8em 0 0; font: 400 0.86rem/1.4 var(--display); color: var(--muted); }
.card-meta a { color: var(--muted); }
.empty-note { font-style: italic; color: var(--muted); padding: 8px 0 72px; }
.pagination { margin: 0 0 64px; font-family: var(--display); }
.pagination .nav-links { display: flex; gap: 8px; }
.pagination .page-numbers { padding: 0.45em 0.85em; border: 1px solid var(--rule); border-radius: 6px; text-decoration: none; }
.pagination .current { border-color: var(--lantern); color: var(--lantern); }

.depth-badge { display: inline-flex; gap: 0.45em; align-items: baseline; font: 600 0.84rem/1 var(--display); padding: 0.42em 0.7em; border-radius: 999px; border: 1px solid rgba(95, 224, 194, 0.4); color: var(--ink); text-decoration: none; white-space: nowrap; }
.depth-badge .depth-m { color: var(--sonar); font-variant-numeric: tabular-nums; }
a.depth-badge:hover { background: rgba(95, 224, 194, 0.1); color: var(--ink); }

.search-form { display: flex; gap: 8px; margin: 1.5em 0; max-width: 30rem; }
.search-form input { flex: 1; min-width: 0; font: 400 1rem/1.2 var(--display); color: var(--ink); background: rgba(4, 9, 22, 0.6); border: 1px solid var(--rule); border-radius: 6px; padding: 0.75em 0.9em; }
.search-form button { font: 600 0.95rem/1 var(--display); color: #10131c; background: var(--lantern); border: 0; border-radius: 6px; padding: 0 1.1em; cursor: pointer; }

/* ------------------------------------------------------------ guide: head */
.entry-head { padding-top: clamp(36px, 6vw, 80px); padding-bottom: clamp(24px, 3vw, 40px); }
.entry-head h1 { max-width: 17em; }
.crumbs { font: 500 0.9rem/1.3 var(--display); margin-bottom: 1.3em; display: flex; gap: 0.6em; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--lantern-pale); text-decoration: underline; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: 1.5em; font: 400 0.9rem/1.4 var(--display); color: var(--muted); }
.entry-meta a:not(.depth-badge) { color: var(--ink); }

/* ------------------------------------------------------------ guide: body */
.entry-grid { display: grid; grid-template-columns: minmax(0, var(--measure)) 15rem; justify-content: space-between; gap: 48px; align-items: start; }
.entry--page .entry-grid { grid-template-columns: minmax(0, var(--measure)); justify-content: start; }
.entry-side { position: sticky; top: 92px; max-height: calc(100vh - 120px); overflow: auto; }

.toc { font-family: var(--display); border-left: 1px solid var(--rule); padding-left: 20px; }
.toc summary { font-weight: 700; font-size: 0.95rem; cursor: pointer; list-style: none; margin-bottom: 0.7em; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; font-size: 0.9rem; line-height: 1.35; padding: 0.4em 0; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc a.is-current { color: var(--lantern-pale); }

@media (max-width: 1023px) {
	.entry-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.entry-side { position: static; max-height: none; order: -1; margin-bottom: 28px; }
	.toc { border: 1px solid var(--rule); border-radius: 8px; padding: 14px 18px; }
	.toc summary { margin: 0; display: flex; justify-content: space-between; }
	.toc summary::after { content: "+"; color: var(--muted); }
	.toc[open] summary { margin-bottom: 0.5em; }
	.toc[open] summary::after { content: "\2212"; }
}

.entry-content { min-width: 0; padding-bottom: 24px; }
.entry-content > * { margin-block: 0 1.25em; }
.entry-content > :last-child { margin-bottom: 0; }
.entry-content h2 { font-size: clamp(1.6rem, 1.35rem + 0.9vw, 2.05rem); margin: 2.1em 0 0.6em; }
.entry-content h3 { font-size: 1.3rem; line-height: 1.25; margin: 1.8em 0 0.5em; letter-spacing: -0.01em; }
.entry-content h4 { font-size: 1.1rem; margin: 1.6em 0 0.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: 0.5em; }
.entry-content li::marker { color: var(--muted); }
.entry-content strong { font-weight: 650; color: #fff; }
.entry-content hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.5em; }
.entry-content code { font: 0.85em/1.4 var(--mono); background: rgba(233, 237, 245, 0.09); padding: 0.15em 0.4em; border-radius: 4px; overflow-wrap: anywhere; }
.entry-content pre { font: 0.9rem/1.6 var(--mono); background: rgba(4, 9, 22, 0.7); border: 1px solid var(--rule); border-radius: 8px; padding: 16px 18px; overflow-x: auto; }
.entry-content pre code { background: none; padding: 0; font-size: inherit; }
.entry-content blockquote, .wp-block-quote { margin-inline: 0; padding: 0.2em 0 0.2em 1.2em; border-left: 2px solid var(--muted); font-style: italic; color: #d3dcec; }
.entry-content blockquote p { margin: 0 0 0.8em; }
.entry-content blockquote p:last-child { margin: 0; }
/* max-width: classic-editor captions carry an inline pixel width (style="width: 1024px") */
.entry-content figure, .entry-content .wp-caption { margin-inline: 0; max-width: 100%; }
.entry-content figure.aligncenter, .entry-content .wp-caption.aligncenter { margin-inline: auto; }
.entry-content figure img { display: block; border-radius: 8px; }
.entry-content figcaption, .wp-caption-text { font: 400 0.88rem/1.45 var(--display); color: var(--muted); margin-top: 0.7em; text-align: left; }

.table-scroll, .wp-block-table { overflow-x: auto; }
.entry-content table { width: 100%; border-collapse: collapse; font: 400 0.95rem/1.45 var(--display); }
.entry-content th, .entry-content td { text-align: left; vertical-align: top; padding: 0.75em 0.9em 0.75em 0; border-bottom: 1px solid var(--rule); }
.entry-content thead th { font-weight: 700; font-size: 0.86rem; color: var(--muted); border-bottom-color: rgba(157, 171, 196, 0.45); }
.entry-content tbody td:first-child, .entry-content tbody th { font-weight: 600; color: #fff; }

/* Signal: the short answer under the title. */
.signal { border-left: 3px solid var(--sonar); background: rgba(4, 9, 22, 0.42); border-radius: 0 10px 10px 0; padding: 20px 24px 22px; font-size: 1.2rem; line-height: 1.6; color: #fff; }
.signal::before { content: "In short"; display: block; font: 700 0.88rem/1 var(--display); color: var(--sonar); margin-bottom: 0.75em; }
.signal > * { margin: 0 0 0.7em; }
.signal > :last-child { margin: 0; }

/* Lantern: the one safety point that matters most. */
.lantern { position: relative; border: 1px solid rgba(242, 177, 52, 0.45); border-radius: 10px; padding: 20px 24px 22px; background: radial-gradient(120% 140% at 0 0, rgba(242, 177, 52, 0.2) 0, rgba(242, 177, 52, 0.05) 46%, rgba(242, 177, 52, 0.03) 100%); }
.lantern::before { content: "Lantern"; display: block; font: 700 0.88rem/1 var(--display); color: var(--lantern); margin-bottom: 0.75em; }
.lantern > * { margin: 0 0 0.7em; }
.lantern > :last-child { margin: 0; }
.lantern li::marker { color: var(--lantern); }

/* Myth Meter: a claim, a three-step dial, the evidence. */
.myth-meter { border: 1px solid var(--rule); border-radius: 10px; padding: 20px 24px 22px; background: var(--raise); }
.myth-claim { font: 700 1.25rem/1.3 var(--display); margin: 0 0 0.8em; }
.myth-claim::before { content: "\201C"; }
.myth-claim::after { content: "\201D"; }
.myth-dial { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 1em; font: 600 0.86rem/1 var(--display); }
.myth-dial span { text-align: center; padding: 0.75em 0.4em; border-radius: 4px; background: rgba(233, 237, 245, 0.07); color: rgba(157, 171, 196, 0.75); }
.myth-dial span:first-child { border-radius: 999px 4px 4px 999px; }
.myth-dial span:last-child { border-radius: 4px 999px 999px 4px; }
.is-true .myth-dial .is-on { background: var(--sonar); color: #052019; }
.is-half-true .myth-dial .is-on { background: var(--lantern); color: #241700; }
.is-myth .myth-dial .is-on { background: var(--down); color: #2a0b03; }
.myth-evidence > * { margin: 0 0 0.7em; }
.myth-evidence > :last-child { margin: 0; }

.editor-note { border: 1px dashed var(--down); border-radius: 8px; padding: 14px 18px; font: 400 0.92rem/1.5 var(--display); color: var(--muted); }
.editor-note-label { color: var(--down); font-weight: 700; margin: 0 0 0.4em; }
.editor-note p { margin: 0 0 0.5em; }

.alignleft { float: left; margin: 0.3em 1.5em 1em 0; }
.alignright { float: right; margin: 0.3em 0 1em 1.5em; }
.aligncenter { margin-inline: auto; display: block; }
.alignwide { max-width: none; }

/* ------------------------------------------------------------ guide: foot */
.entry-foot { padding-top: 40px; padding-bottom: 72px; }
.entry-foot-inner { max-width: var(--measure); display: grid; gap: 24px; }
.author-box { border-top: 1px solid var(--rule); padding-top: 24px; font-family: var(--display); }
.author-name { font-weight: 700; font-size: 1.05rem; margin: 0; }
.author-bio { font-size: 0.95rem; line-height: 1.55; color: #c9d3e6; margin: 0.5em 0 0; }
.author-note { font-size: 0.9rem; line-height: 1.5; color: var(--muted); margin: 0.7em 0 0; }
.deeper { display: block; text-decoration: none; border: 1px solid rgba(95, 224, 194, 0.35); border-radius: 10px; padding: 20px 24px 22px; background: rgba(4, 9, 22, 0.5); }
.deeper:hover { border-color: var(--sonar); }
.deeper-label { display: block; font: 600 0.9rem/1.3 var(--display); color: var(--sonar); margin-bottom: 0.5em; }
.deeper-title { display: block; font: 700 1.4rem/1.2 var(--display); letter-spacing: -0.015em; color: var(--ink); }

/* ------------------------------------------------------------ depth gauge (guides) */
.gauge { font-family: var(--display); pointer-events: none; }
/* wide screens: a ruler down the left edge, with a marker that sinks as you read */
@media (min-width: 1400px) {
	.gauge { position: fixed; z-index: 5; top: 120px; bottom: 56px; left: max(22px, calc(50vw - var(--wide) / 2 - 104px)); width: 96px; }
	.gauge-track { position: absolute; left: 0; top: 0; bottom: 0; width: 13px; border-left: 1px solid rgba(95, 224, 194, 0.4); background: repeating-linear-gradient(180deg, rgba(95, 224, 194, 0.4) 0 1px, transparent 1px 10%); background-size: 7px 100%; background-repeat: no-repeat; }
	.gauge-mark { position: absolute; left: -1px; top: calc(var(--p) * 100%); width: 18px; height: 2px; background: var(--sonar); }
	.gauge-read { position: absolute; left: 26px; top: calc(var(--p) * 100%); transform: translateY(-50%); margin: 0; display: flex; flex-direction: column; gap: 3px; white-space: nowrap; }
}
/* smaller screens: a progress line under the header and a small readout in the corner */
@media (max-width: 1399px) {
	.gauge-track { position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: 2px; }
	.gauge-mark { display: block; height: 100%; background: var(--sonar); transform-origin: 0 50%; transform: scaleX(var(--p)); }
	.gauge-read { position: fixed; z-index: 40; right: 14px; bottom: 14px; margin: 0; display: flex; gap: 8px; align-items: baseline; background: rgba(4, 9, 22, 0.88); border: 1px solid rgba(95, 224, 194, 0.4); border-radius: 999px; padding: 0.5em 0.9em; }
}
.gauge-m { font-weight: 800; font-size: 0.98rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--sonar); }
.gauge-zone { font-weight: 500; font-size: 0.8rem; line-height: 1; color: var(--muted); }

/* ------------------------------------------------------------ Sonar Index tables (markup from the itsdark-sonar plugin) */
body .sonar-wrap { --sonar-muted: var(--muted); --sonar-rule: var(--rule); --sonar-live: var(--sonar); --sonar-down: var(--down); --sonar-retired: #8792a8; --sonar-pending: var(--lantern); font-family: var(--display); margin-top: 1em; }
body .sonar-index { font-size: 0.95rem; line-height: 1.45; }
body .sonar-index th { font-size: 0.84rem; text-transform: none; letter-spacing: 0; font-weight: 700; padding-left: 0; }
body .sonar-index td { padding-left: 0; padding-right: 1.1em; }
body .sonar-index td:first-child { font-weight: 400; color: inherit; }
body .sonar-index td:first-child > strong, body .sonar-index td:first-child > a { font-size: 1.05rem; font-weight: 700; color: #fff; }
.sonar-addr { font-family: var(--mono); color: #d3dcec; }
/* On the Index page there is room for the whole address on one line. Inside an article the table has to fit the text column. */
@media (min-width: 1180px) { body .sonar-page .sonar-addr { word-break: normal; white-space: nowrap; } }
body .entry-content .sonar-addr { white-space: normal; word-break: break-all; }
.entry-content .sonar-index td:first-child { min-width: 11.5rem; }
.entry-content .sonar-index td { padding-right: 0.9em; }
.sonar-copy { font-family: var(--display); border-radius: 999px !important; }
.sonar-copy:hover { border-color: var(--lantern) !important; color: var(--lantern-pale) !important; }
.sonar-badge { font-weight: 700; }
.sonar-badge::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 0.5em; vertical-align: 0.06em; }
p.sonar-stats { font-family: var(--display); font-size: 0.98rem; color: var(--muted); }
p.sonar-stats strong { color: var(--sonar); }

.sonar-page .sonar-panel { max-width: 30rem; margin-bottom: 48px; }
/* wide screens: use the full width. Index page: status panel beside the heading, guides beside their label.
   Section pages: heading in the left column, the list of guides in the right. */
@media (min-width: 1000px) {
	.sonar-page { display: grid; grid-template-columns: minmax(0, 1fr) 23rem; column-gap: clamp(32px, 6vw, 88px); }
	.sonar-page > * { grid-column: 1 / -1; min-width: 0; }
	.sonar-page > .archive-head { grid-column: 1; }
	.sonar-page > .sonar-panel { grid-column: 2; align-self: end; max-width: none; margin-bottom: clamp(24px, 4vw, 40px); }
	.sonar-guides { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; border-top: 1px solid var(--rule); padding-top: 36px; margin-top: 8px; }
	.sonar-guides .cards { max-width: none; margin-bottom: 28px; }
	.archive-layout { display: grid; grid-template-columns: 19rem minmax(0, 1fr); column-gap: clamp(28px, 5vw, 72px); align-items: start; }
	.archive-layout > .archive-head { position: sticky; top: 88px; max-width: none; }
	.archive-layout > :not(.archive-head) { grid-column: 2; }
	.archive-layout > .archive-head h1 { font-size: clamp(2rem, 1.4rem + 1.6vw, 2.7rem); }
	.archive-layout > .archive-head .desc { font-size: 1.05rem; }
	.archive-layout > .cards { max-width: none; padding-top: clamp(40px, 7vw, 88px); }
	.archive-layout > .cards > .card:first-child { border-top: 0; padding-top: 0; }
	.archive-layout > .empty-note { padding-top: clamp(40px, 7vw, 88px); }
}
.sonar-page h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem); }
.sonar-guides { margin-bottom: 16px; }
.sonar-guides .cards { margin-bottom: 32px; }
.sonar-guides .card:first-child { border-top: 0; }
.sonar-jump { font-family: var(--display); margin-bottom: 8px; }
.sonar-jump ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sonar-jump a { display: block; font-weight: 600; font-size: 0.9rem; line-height: 1; padding: 0.65em 0.95em; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink); text-decoration: none; }
.sonar-jump a:hover { border-color: var(--sonar); }
.sonar-section { padding-top: 44px; }
.sonar-rules { margin: 64px 0 80px; padding-top: 40px; border-top: 1px solid var(--rule); max-width: 46rem; }
.sonar-rules ul { padding-left: 1.2em; margin: 1em 0 1.6em; }
.sonar-rules li { margin-bottom: 0.5em; }
.sonar-rules .button { margin: 0 8px 8px 0; }

/* ------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--rule); background: #03050b; padding: 0 0 36px; font-family: var(--display); font-size: 0.95rem; line-height: 1.55; }
.pledge { margin: 0; padding: 22px 0; border-bottom: 1px solid var(--rule); font-weight: 600; font-size: 1.02rem; color: var(--ink); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pledge a { font-weight: 500; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) 1fr 1fr; gap: 40px; padding: 40px 0 32px; }
.foot-tagline { margin: 0; max-width: 26em; color: #c9d3e6; }
.onion { margin: 1.2em 0 0; color: var(--muted); font-size: 0.88rem; }
.onion code { display: block; font: 0.72rem/1.5 var(--mono); color: #d3dcec; overflow-wrap: anywhere; margin-top: 0.3em; }
.foot-head { font-size: 0.95rem; font-weight: 700; letter-spacing: 0; margin: 0 0 0.8em; }
.foot-col ul, .foot-legal { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin-bottom: 0.45em; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--lantern-pale); text-decoration: underline; }
.site-footer .pledge a { color: var(--lantern-pale); text-decoration: underline; }
.foot-base { border-top: 1px solid var(--rule); padding-top: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; font-size: 0.86rem; color: var(--muted); }
.foot-base p { margin: 0; }
.foot-legal { display: flex; flex-wrap: wrap; gap: 6px 20px; }
@media (max-width: 799px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-about { grid-column: 1 / -1; } }
@media (max-width: 479px) { .foot-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ share buttons */
.share { font-family: var(--display); }
.share-label { font-weight: 700; font-size: 0.95rem; line-height: 1.3; margin: 0 0 0.7em; color: var(--ink); }
.share ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.share li { margin: 0; }
.share-btn { display: inline-flex; align-items: center; gap: 0.5em; min-height: 40px; box-sizing: border-box; font: 600 0.88rem/1 var(--display); color: var(--ink); background: rgba(233, 237, 245, 0.05); border: 1px solid var(--rule); border-radius: 999px; padding: 0 1em; text-decoration: none; cursor: pointer; white-space: nowrap; }
.share-btn:hover { color: var(--ink); border-color: var(--lantern); background: rgba(242, 177, 52, 0.1); }
.share-btn[hidden] { display: none; }
.share-icon { flex: none; width: 16px; height: 16px; }
/* the two tools lead the row and carry the accent */
.share-copy, .share-native { border-color: rgba(242, 177, 52, 0.5); color: var(--lantern-pale); }
.share-copy.is-done { border-color: var(--sonar); color: var(--sonar); }
.share--compact { margin-top: 28px; border-left: 1px solid var(--rule); padding-left: 20px; }
.share--compact ul { gap: 6px; }
.share--compact .share-btn { min-height: 32px; font-size: 0.8rem; padding: 0 0.8em; }
.sonar-rules .share { margin-top: 36px; }
@media (max-width: 1023px) { .share--compact { display: none; } } /* the full row under the guide covers small screens */
@media print { .share { display: none; } }

/* ------------------------------------------------------------ sea life (decorative) */
body.sea-full { --sea: 1; }
body.sea-mild { --sea: 0.45; }
.zone { position: relative; overflow: hidden; }
.zone > .wrap { position: relative; z-index: 1; }
.sea { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: var(--sea, 0); }
.sea svg { position: absolute; overflow: visible; }
.sea .sea-line { fill: none; stroke-width: 2.4; stroke-linecap: round; }
/* each zone's life is one step lighter than its water */
.sea--surface { fill: #21447e; }
.sea--twilight { fill: #19325f; stroke: #19325f; }
.sea--midnight { fill: #122449; stroke: #1a3160; }
.sea--abyss { fill: #7d8fb3; }
.sea-rays { top: 0; right: 0; width: min(40vw, 560px); height: 100%; fill: rgba(233, 237, 245, 0.035); }
/* creatures keep to the page margins and drift in from the edge, clear of the titles */
.sea-school { right: -30px; bottom: 12%; width: clamp(150px, 19vw, 280px); animation: sea-drift 26s ease-in-out infinite alternate; }
.sea-jelly--a { right: max(2vw, calc(50vw - 690px)); top: 12%; width: clamp(48px, 5.4vw, 76px); animation: sea-rise 9s ease-in-out infinite alternate; }
.sea-jelly--b { right: max(9vw, calc(50vw - 600px)); bottom: 5%; width: clamp(30px, 3.4vw, 46px); opacity: 0.75; animation: sea-rise 12s ease-in-out infinite alternate-reverse; }
.sea-squid { left: max(1vw, calc(50vw - 700px)); bottom: 9%; width: clamp(90px, 10vw, 150px); opacity: 0.8; }
.sea-angler { right: max(1vw, calc(50vw - 700px)); bottom: 10%; width: clamp(130px, 15vw, 215px); }
.sea-angler .sea-lure { fill: var(--lantern); stroke: none; }
.sea-angler .sea-glow { fill: var(--lantern); stroke: none; opacity: 0.2; }
.sea-sparks { left: max(2vw, calc(50vw - 700px)); top: 8%; width: clamp(140px, 18vw, 260px); fill: var(--sonar); opacity: 0.4; }
.sea-snow { inset: 0; width: 100%; height: 100%; opacity: 0.5; }
/* one creature beside a guide's title */
.entry { position: relative; }
.entry > .entry-head, .entry > .entry-grid, .entry > .entry-foot { position: relative; z-index: 1; }
.sea-head { inset: 0 0 auto auto; width: min(38vw, 520px); height: 320px; display: none; }
@media (min-width: 1100px) { .sea-head { display: block; } }
.sea-head .sea-school { right: 24px; top: 110px; bottom: auto; width: 240px; animation: none; }
.sea-head .sea-jelly { right: 70px; top: 84px; width: 70px; }
.sea-head .sea-angler { right: 44px; top: 96px; bottom: auto; width: 205px; }
.sea-head.sea--surface { fill: #24498a; }
.sea-head.sea--twilight { fill: #1b3668; stroke: #1b3668; }
.sea-head.sea--midnight { fill: #142a56; stroke: #1d3870; }
@keyframes sea-drift { from { transform: translateX(0); } to { transform: translateX(-34px); } }
@keyframes sea-rise { from { transform: translateY(8px); } to { transform: translateY(-10px); } }

.seafloor { height: clamp(90px, 13vw, 190px); margin-top: clamp(8px, 2vw, 24px); margin-bottom: -1px; pointer-events: none; opacity: calc(0.4 + var(--sea, 0) * 0.6); }
.seafloor svg { display: block; width: 100%; height: 100%; }
.seafloor-far { fill: #0b1630; }
.seafloor-near { fill: #060b18; stroke: #16244a; stroke-width: 1.5; }
.seafloor-vent { fill: #122045; }
.seafloor-plume { fill: #1a2b57; opacity: 0.75; }
.seafloor-worms { fill: none; stroke: #1b2c58; stroke-width: 5; stroke-linecap: round; }
.seafloor-tips { fill: #9a4a3e; }
.seafloor-star { fill: #2a3f73; }
body:not(.sea-off) .site-footer { border-top: 0; background: #060b18; } /* the footer is the sea bed */
body.sea-off .seafloor { display: none; }
@media (max-width: 799px) { .sea-squid, .sea-jelly--b, .sea-sparks, .sea-rays { display: none; } .sea-school, .sea-angler, .sea-jelly--a { opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .sea-school, .sea-jelly--a, .sea-jelly--b { animation: none; } }
@media print { .sea, .seafloor { display: none; } }

/* ------------------------------------------------------------ cookie notice */
.cookie-note { position: fixed; z-index: 70; left: 20px; bottom: 20px; width: min(26rem, calc(100vw - 40px)); background: #0a1226; border: 1px solid rgba(242, 177, 52, 0.45); border-radius: 10px; padding: 18px 20px 20px; font-family: var(--display); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
.cookie-note[hidden] { display: none; }
.cookie-note-title { font-weight: 700; font-size: 1rem; line-height: 1.3; margin: 0 0 0.4em; color: var(--ink); }
.cookie-note-text { font-size: 0.92rem; line-height: 1.5; color: #c9d3e6; margin: 0; }
.cookie-note-text a { white-space: nowrap; }
.cookie-note-actions { display: flex; gap: 10px; margin: 14px 0 0; }
.cookie-note-actions .button { cursor: pointer; font-size: 0.92rem; padding: 0.7em 1.2em; }
.cookie-note[data-mode="consent"] .cookie-note-actions .button { flex: 1; text-align: center; } /* Accept and Decline carry equal weight */
.cookie-reopen { font: inherit; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.cookie-reopen:hover { color: var(--lantern-pale); text-decoration: underline; }
.cookie-reopen[hidden] { display: none; }
@media (max-width: 599px) { .cookie-note { left: 12px; right: 12px; bottom: 12px; width: auto; } body.has-descent .cookie-note { bottom: 62px; } }
@media print { .cookie-note { display: none; } }

/* ------------------------------------------------------------ loading animation (the dive) */
.dive { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: radial-gradient(60% 50% at 50% 46%, rgba(15, 33, 71, 0.975) 0, rgba(4, 7, 15, 0.985) 100%); opacity: 0; transition: opacity 0.25s ease; }
.dive[hidden] { display: none; }
.dive.is-on { opacity: 1; }
.dive-inner { text-align: center; }
.dive-fish { display: block; width: clamp(150px, 26vw, 210px); height: auto; overflow: visible; margin-inline: auto; animation: dive-bob 2.6s ease-in-out infinite; }
.dive-body, .dive-tail path { fill: #1d3a6b; }
.dive-fin { fill: #16305e; }
.dive-fin--side { fill: #102449; }
.dive-teeth { fill: none; stroke: #e9edf5; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; opacity: 0.85; }
.dive-eye { fill: #e9edf5; }
.dive-pupil { fill: #04070f; }
.dive-stalk { fill: none; stroke: #2a4f8f; stroke-width: 2.5; stroke-linecap: round; }
.dive-lure { fill: var(--lantern); }
.dive-glow { fill: var(--lantern); opacity: 0.22; transform-box: fill-box; transform-origin: center; animation: dive-glow 1.8s ease-in-out infinite; }
.dive-tail { transform-box: fill-box; transform-origin: 100% 50%; animation: dive-tail 0.9s ease-in-out infinite; }
.dive-text { font: 600 0.95rem/1 var(--display); color: var(--lantern-pale); margin: 22px 0 0; }
@keyframes dive-bob { 0%, 100% { transform: translate(-6px, -5px) rotate(-1.5deg); } 50% { transform: translate(6px, 6px) rotate(1.5deg); } }
@keyframes dive-tail { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
@keyframes dive-glow { 0%, 100% { transform: scale(0.8); opacity: 0.16; } 50% { transform: scale(1.25); opacity: 0.34; } }
@media (prefers-reduced-motion: reduce) { .dive { transition: none; } .dive-fish, .dive-tail, .dive-glow { animation: none; } }
@media print { .dive { display: none; } }

/* leave room for the corner depth readout on guides */
@media (max-width: 1399px) { body.has-descent .site-footer { padding-bottom: 72px; } }

@media (prefers-reduced-motion: reduce) {
	.ping::after { animation: none; display: none; }
	html { scroll-behavior: auto; }
}
@media print {
	.site-header, .site-footer, .gauge, .entry-side, .deeper { display: none; }
	body { background: #fff; color: #000; }
	body::before { display: none; }
}
