/*
Theme Name: tty1
Theme URI: https://veruse.dev
Author: veruse
Author URI: https://veruse.dev
Description: A dark terminal-style theme for ramblings and dev notes. Monospace everything, ANSI-flavored colors, prompt-driven navigation.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tty1
Tags: blog, dark, one-column
*/

/* ---------------------------------------------------------------------------
 * tokens
 * ------------------------------------------------------------------------ */

:root {
	--bg:       #101413;
	--bg-alt:   #171c1a;
	--fg:       #c6cec6;
	--bright:   #eef2ee;
	--dim:      #64746a;
	--green:    #8fce91;
	--amber:    #d8a657;
	--blue:     #89a7cb;
	--magenta:  #c288ad;
	--cyan:     #83c5c0;
	--red:      #d3868f;
	--border:   #232b27;
	--mono: ui-monospace, "JetBrains Mono", "Fira Code", "Cascadia Code",
	        SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	--measure: 78ch;
}

/* ---------------------------------------------------------------------------
 * base
 * ------------------------------------------------------------------------ */

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

html {
	-webkit-text-size-adjust: 100%;
	scrollbar-color: var(--border) var(--bg);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--mono);
	font-size: 15px;
	line-height: 1.7;
	font-variant-ligatures: none;
}

/* faint scanlines — barely there */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 9999;
	background: repeating-linear-gradient(
		to bottom,
		transparent 0px,
		transparent 2px,
		rgba(0, 0, 0, 0.09) 3px
	);
	mix-blend-mode: multiply;
}

::selection {
	background: var(--amber);
	color: var(--bg);
}

a {
	color: var(--amber);
	text-decoration: none;
}

a:hover,
a:focus {
	background: var(--amber);
	color: var(--bg);
	outline: none;
}

a:focus-visible {
	outline: 1px dashed var(--amber);
	outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
	color: var(--bright);
	font-weight: 700;
	line-height: 1.3;
	margin: 2.2em 0 0.6em;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4, h5, h6 { font-size: 1rem; }

/* markdown-style heading markers inside post content */
.entry-content h2::before { content: "## ";  color: var(--dim); }
.entry-content h3::before { content: "### "; color: var(--dim); }
.entry-content h4::before { content: "#### "; color: var(--dim); }

p { margin: 0 0 1.4em; }

hr {
	border: 0;
	border-top: 1px dashed var(--border);
	margin: 2.5em 0;
}

img {
	max-width: 100%;
	height: auto;
	border: 1px solid var(--border);
}

figure { margin: 1.5em 0; }

figcaption,
.wp-caption-text {
	color: var(--dim);
	font-size: 0.85em;
	padding-top: 0.4em;
}

figcaption::before,
.wp-caption-text::before { content: "# "; }

blockquote {
	margin: 1.5em 0;
	padding: 0 0 0 1.2em;
	border-left: 2px solid var(--dim);
	color: var(--dim);
	font-style: normal;
}

blockquote p { margin-bottom: 0.6em; }

ul, ol { padding-left: 2ch; margin: 0 0 1.4em; }

.entry-content ul { list-style: none; }

.entry-content ul > li::before {
	content: "* ";
	color: var(--dim);
	margin-left: -2ch;
}

table {
	border-collapse: collapse;
	width: 100%;
	margin: 1.5em 0;
	font-size: 0.9em;
}

th, td {
	border: 1px solid var(--border);
	padding: 0.4em 0.8em;
	text-align: left;
}

th { color: var(--bright); background: var(--bg-alt); }

/* ---------------------------------------------------------------------------
 * code
 * ------------------------------------------------------------------------ */

code, kbd, samp, pre {
	font-family: var(--mono);
	font-size: 0.92em;
}

code {
	background: var(--bg-alt);
	color: var(--cyan);
	padding: 0.1em 0.4em;
	border-radius: 2px;
}

pre,
.wp-block-code {
	background: var(--bg-alt);
	border: 1px solid var(--border);
	padding: 1em 1.2em;
	overflow-x: auto;
	margin: 1.5em 0;
	line-height: 1.55;
}

pre code {
	background: none;
	color: var(--fg);
	padding: 0;
}

kbd {
	border: 1px solid var(--dim);
	border-bottom-width: 2px;
	border-radius: 3px;
	padding: 0.05em 0.4em;
	font-size: 0.85em;
}

/* ---------------------------------------------------------------------------
 * layout
 * ------------------------------------------------------------------------ */

.site {
	max-width: var(--measure);
	margin: 0 auto;
	padding: 1.5rem 1.25rem 3rem;
}

/* ---------------------------------------------------------------------------
 * header
 * ------------------------------------------------------------------------ */

.site-header {
	margin-bottom: 2.5rem;
}

.prompt-line {
	color: var(--fg);
	margin: 0;
}

.prompt-user  { color: var(--green); font-weight: 700; }
.prompt-user .at::before { content: "@"; }
.prompt-path  { color: var(--blue);  font-weight: 700; }
.prompt-sigil { color: var(--fg); }
.prompt-cmd   { color: var(--bright); }

.site-title {
	font-size: 1.5rem;
	margin: 0.8rem 0 0;
	color: var(--bright);
}

.site-title a { color: inherit; }

.site-title a:hover,
.site-title a:focus {
	background: var(--bright);
	color: var(--bg);
}

.site-description {
	margin: 0.2rem 0 0;
	color: var(--dim);
}

.site-description::before { content: "# "; }

/* nav — entries listed like executables */
.site-nav {
	margin-top: 1.4rem;
	padding-top: 1rem;
	border-top: 1px dashed var(--border);
}

.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em 2ch;
}

.site-nav a { color: var(--green); }

.site-nav a::before { content: "./"; color: var(--dim); }

.site-nav a:hover,
.site-nav a:focus {
	background: var(--green);
	color: var(--bg);
}

.site-nav a:hover::before,
.site-nav a:focus::before { color: var(--bg); }

.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------------------------------------------------------------------------
 * post listing — ls -l style
 * ------------------------------------------------------------------------ */

.listing-cmd { margin-bottom: 1.6rem; }

.post-row {
	margin-bottom: 1.8rem;
	animation: stream-in 0.25s ease-out backwards;
}

.post-row:nth-child(1)  { animation-delay: 0.05s; }
.post-row:nth-child(2)  { animation-delay: 0.12s; }
.post-row:nth-child(3)  { animation-delay: 0.19s; }
.post-row:nth-child(4)  { animation-delay: 0.26s; }
.post-row:nth-child(5)  { animation-delay: 0.33s; }
.post-row:nth-child(6)  { animation-delay: 0.40s; }
.post-row:nth-child(7)  { animation-delay: 0.47s; }
.post-row:nth-child(8)  { animation-delay: 0.54s; }
.post-row:nth-child(n+9) { animation-delay: 0.6s; }

@keyframes stream-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: none; }
}

.post-row-head {
	display: flex;
	flex-wrap: wrap;
	gap: 0 2ch;
	align-items: baseline;
}

.post-perms { color: var(--dim); }
.post-date  { color: var(--magenta); white-space: nowrap; }

.post-row-head .entry-title {
	font-size: 1rem;
	margin: 0;
	font-weight: 700;
}

.post-row-head .entry-title a { color: var(--amber); }

.post-row-head .entry-title a::after { content: ".md"; color: var(--dim); }

.post-row-head .entry-title a:hover,
.post-row-head .entry-title a:focus { color: var(--bg); }

.post-row-head .entry-title a:hover::after,
.post-row-head .entry-title a:focus::after { color: var(--bg); }

.post-excerpt {
	margin: 0.3em 0 0;
	padding-left: 4ch;
	color: var(--fg);
}

.post-excerpt p { margin: 0; }

.post-cats { padding-left: 4ch; }

.post-cats a { color: var(--blue); }

.post-cats a::before { content: "~/"; color: var(--dim); }

.post-cats a:hover,
.post-cats a:focus { background: var(--blue); color: var(--bg); }

.post-cats a:hover::before,
.post-cats a:focus::before { color: var(--bg); }

/* pager, styled after less(1) */
.pager {
	margin-top: 3rem;
	padding-top: 1rem;
	border-top: 1px dashed var(--border);
	display: flex;
	justify-content: space-between;
	gap: 2ch;
}

.pager .colon { color: var(--dim); }

/* ---------------------------------------------------------------------------
 * single post / page
 * ------------------------------------------------------------------------ */

.entry-header { margin-bottom: 2rem; }

.entry-header .entry-title {
	margin: 1rem 0 1.2rem;
	font-size: 1.5rem;
}

.frontmatter {
	color: var(--dim);
	margin: 0 0 0.5rem;
}

.frontmatter .fm-key { color: var(--dim); }
.frontmatter .fm-val { color: var(--magenta); }
.frontmatter a       { color: var(--blue); }

.frontmatter a:hover,
.frontmatter a:focus { background: var(--blue); color: var(--bg); }

.fm-fence { color: var(--dim); }

.entry-content > *:first-child { margin-top: 0; }

.entry-content a { text-decoration: underline; text-underline-offset: 3px; }

.entry-content a:hover,
.entry-content a:focus { text-decoration: none; }

.entry-footer {
	margin-top: 3rem;
	padding-top: 1rem;
	border-top: 1px dashed var(--border);
	color: var(--dim);
}

.entry-footer a { color: var(--cyan); }

.entry-footer a:hover,
.entry-footer a:focus { background: var(--cyan); color: var(--bg); }

.post-nav {
	display: flex;
	justify-content: space-between;
	gap: 2ch;
	margin-top: 2rem;
}

.post-nav a { color: var(--green); }

.post-nav a:hover,
.post-nav a:focus { background: var(--green); color: var(--bg); }

/* ---------------------------------------------------------------------------
 * archive / search headers
 * ------------------------------------------------------------------------ */

.archive-header { margin-bottom: 2rem; }

.archive-header .match-count {
	color: var(--dim);
	margin-top: 0.3rem;
}

/* ---------------------------------------------------------------------------
 * search form — grep prompt
 * ------------------------------------------------------------------------ */

.search-form .prompt-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 1ch;
}

.search-form .search-field {
	background: transparent;
	border: none;
	border-bottom: 1px dashed var(--dim);
	color: var(--bright);
	font: inherit;
	padding: 0 0.2em;
	width: 24ch;
	max-width: 100%;
}

.search-form .search-field:focus {
	outline: none;
	border-bottom-color: var(--amber);
}

.search-form .search-submit {
	background: transparent;
	border: 1px solid var(--green);
	color: var(--green);
	font: inherit;
	padding: 0 1ch;
	cursor: pointer;
}

.search-form .search-submit:hover,
.search-form .search-submit:focus {
	background: var(--green);
	color: var(--bg);
}

/* ---------------------------------------------------------------------------
 * 404
 * ------------------------------------------------------------------------ */

.error-line   { color: var(--red); }
.exit-status  { color: var(--dim); }

/* ---------------------------------------------------------------------------
 * comments — irc log
 * ------------------------------------------------------------------------ */

.comments-area {
	margin-top: 3.5rem;
	padding-top: 1.5rem;
	border-top: 1px dashed var(--border);
}

.comments-title {
	font-size: 1rem;
	margin: 0 0 1.5rem;
	color: var(--dim);
	font-weight: 400;
}

.comment-list,
.comment-list .children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list .children { padding-left: 3ch; }

.comment-body { margin-bottom: 1.2rem; }

.comment-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1ch;
	align-items: baseline;
}

.comment-time { color: var(--dim); font-size: 0.85em; }

.comment-author-nick { color: var(--green); font-weight: 700; }

.comment-author-nick::before { content: "<"; color: var(--dim); font-weight: 400; }
.comment-author-nick::after  { content: ">"; color: var(--dim); font-weight: 400; }

.bypostauthor > .comment-body .comment-author-nick { color: var(--cyan); }

.comment-content { padding-left: 3ch; }

.comment-content p { margin-bottom: 0.4em; }

.comment-awaiting-moderation {
	color: var(--dim);
	padding-left: 3ch;
	font-style: normal;
}

.comment-awaiting-moderation::before { content: "-- "; }

.reply { padding-left: 3ch; }

.comment-reply-link,
.comment-edit-link {
	color: var(--dim);
	font-size: 0.85em;
}

.comment-reply-link::before { content: "↳ "; }

.comment-reply-link:hover,
.comment-reply-link:focus,
.comment-edit-link:hover,
.comment-edit-link:focus {
	background: var(--dim);
	color: var(--bg);
}

/* comment form */
.comment-respond { margin-top: 2rem; }

.comment-reply-title {
	font-size: 1rem;
	margin: 0 0 1rem;
	color: var(--bright);
}

.comment-form label {
	display: block;
	color: var(--dim);
	margin-bottom: 0.2em;
}

.comment-form label::before { content: "--"; }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	background: var(--bg-alt);
	border: 1px solid var(--border);
	color: var(--bright);
	font: inherit;
	padding: 0.5em 0.8em;
	margin-bottom: 1em;
}

.comment-form input:focus,
.comment-form textarea:focus {
	outline: none;
	border-color: var(--amber);
}

.comment-form input[type="checkbox"] { accent-color: var(--green); }

.comment-form .submit {
	background: transparent;
	border: 1px solid var(--green);
	color: var(--green);
	font: inherit;
	padding: 0.3em 1.5ch;
	cursor: pointer;
}

.comment-form .submit:hover,
.comment-form .submit:focus {
	background: var(--green);
	color: var(--bg);
}

.comment-notes,
.logged-in-as {
	color: var(--dim);
	font-size: 0.9em;
}

/* ---------------------------------------------------------------------------
 * footer
 * ------------------------------------------------------------------------ */

.site-footer {
	margin-top: 4rem;
	padding-top: 1.2rem;
	border-top: 1px dashed var(--border);
	color: var(--dim);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5em 2ch;
}

.site-footer a { color: var(--dim); }

.site-footer a:hover,
.site-footer a:focus { background: var(--dim); color: var(--bg); }

.exit-code .ok { color: var(--green); }

/* ---------------------------------------------------------------------------
 * wp core compat
 * ------------------------------------------------------------------------ */

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	overflow: hidden;
	position: absolute !important;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	position: fixed !important;
	top: 0.5rem;
	left: 0.5rem;
	background: var(--bg-alt);
	color: var(--amber);
	padding: 0.5em 1em;
	z-index: 100000;
	outline: 1px dashed var(--amber);
}

.alignleft { float: left; margin: 0.5em 1.5em 1em 0; }
.alignright { float: right; margin: 0.5em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

.wp-caption { max-width: 100%; }

.sticky .post-perms::after { content: " *"; color: var(--amber); }

.gallery { display: flex; flex-wrap: wrap; gap: 1em; }

.post-password-form input[type="password"] {
	background: var(--bg-alt);
	border: 1px solid var(--border);
	color: var(--bright);
	font: inherit;
	padding: 0.3em 0.6em;
}

/* ---------------------------------------------------------------------------
 * responsive + motion
 * ------------------------------------------------------------------------ */

@media (max-width: 600px) {
	body { font-size: 14px; }
	.post-excerpt, .post-cats { padding-left: 0; }
	.post-perms { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.post-row { animation: none; }
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
