:root {
	--bg: #0a0907;
	--surface: #14110d;
	--paper: #1c1814;
	--paper-warm: #221c16;
	--line: #2a241d;
	--hairline: #3d342a;
	--text: #f1ead8;
	--text-soft: #d8cfba;
	--muted: #7a6f5e;
	--muted-deep: #4a4337;
	--accent: #ff6a1f;
	--accent-soft: #f59963;
	--accent-glow: #ff6a1f33;
	--fresh: #b8c994;
	--alarm: #f04438;
	--rgb-r: oklch(0.72 0.22 22);
	--rgb-b: oklch(0.72 0.18 245);

	--font-display: "Fraunces", "Times New Roman", Georgia, serif;
	--font-mono: "DM Mono", ui-monospace, "Courier New", monospace;

	--max-width: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-display);
	font-variation-settings: "opsz" 24;
	min-height: 100vh;
	padding: clamp(1.5rem, 4vw, 3.25rem) clamp(1rem, 5vw, 4rem) 4rem;
	max-width: var(--max-width);
	margin: 0 auto;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	position: relative;
	overflow-x: hidden;
}

/* Atmospheric warmth — a single soft top-right glow, low-key, gives the page warmth without screaming */
body::before {
	content: "";
	position: fixed;
	top: -20vh;
	right: -10vw;
	width: 70vw;
	height: 70vh;
	background: radial-gradient(circle at center, rgba(255, 106, 31, 0.07), transparent 60%);
	pointer-events: none;
	z-index: 0;
}

/* Subtle paper grain — barely-there texture so dark surfaces don't read as flat plastic */
.grain {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	opacity: 0.10;
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

body > * { position: relative; z-index: 2; }

/* ───── MASTHEAD ───── */
.masthead {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	padding-bottom: 1.6rem;
	border-bottom: 1px solid var(--hairline);
	margin-bottom: 1.5rem;
	gap: 2rem;
}

/* ───── LIVING LOGO (S13c) ───── */
/* sleepy-blink ambient + tag-lockup glitch with RGB ghosts and < > brackets */
.masthead-title h1.logo {
	position: relative;
	font-family: var(--font-display);
	font-style: italic;
	font-weight: 300;
	font-size: clamp(3.25rem, 9vw, 6rem);
	line-height: 1;
	letter-spacing: -0.022em;
	font-variation-settings: "opsz" 144;
	color: var(--text);
	display: inline-flex;
	align-items: baseline;
	cursor: default;
	user-select: none;
	padding: 4px 0.55em;
	margin: -4px -0.55em;
	outline: 1px dashed transparent;
}

.logo .word-clip {
	display: inline-flex;
	align-items: baseline;
	position: relative;
	z-index: 1;
}

.logo .ch {
	display: inline-block;
}

.logo .dot,
.logo .dot-static {
	color: var(--accent);
	font-style: normal;
	font-weight: 500;
	display: inline-block;
	transform-origin: center 80%;
	will-change: transform;
}

/* Ambient — sleepy blink (only the dot, every ~5 seconds) */
.logo.sleepy .dot {
	animation: sleepy-blink 4.8s ease-in-out infinite;
}
@keyframes sleepy-blink {
	0%, 92%, 100% { transform: scaleY(1); }
	94%, 98%      { transform: scaleY(0.05); }
}

/* RGB chromatic ghost layers */
.logo .ghost {
	position: absolute;
	left: 0.55em;
	top: 4px;
	pointer-events: none;
	mix-blend-mode: screen;
	opacity: 0;
	will-change: transform, opacity;
	display: inline-flex;
	align-items: baseline;
	font-family: inherit;
	font-style: inherit;
	letter-spacing: inherit;
}

/* Brackets pop in around the wordmark */
.logo .br {
	position: absolute;
	top: 50%;
	font-family: var(--font-mono);
	font-style: normal;
	font-weight: 500;
	font-size: 0.7em;
	line-height: 1;
	color: var(--accent);
	pointer-events: none;
	opacity: 0;
	transform: translate(0, -50%) scale(0.4);
	transition: transform 280ms cubic-bezier(.2, 1.4, .3, 1) 360ms,
	            opacity 140ms ease-out 380ms;
}
.logo .br.left  { left: 0;  transform-origin: right center; }
.logo .br.right { right: 0; transform-origin: left center; }

/* Tag-lockup: triggered on intro and on hover via .is-hover class */
.logo.is-hover .ghost { opacity: 1; }
.logo.is-hover .ghost.r {
	color: var(--rgb-r);
	animation: tag-r 600ms steps(2) 2 forwards, tag-fade 720ms ease-out forwards;
}
.logo.is-hover .ghost.b {
	color: var(--rgb-b);
	animation: tag-b 600ms steps(2) 2 forwards, tag-fade 720ms ease-out forwards;
}
.logo.is-hover .word-clip {
	animation: tag-clip 600ms steps(2) 2 forwards;
}
.logo.is-hover .br {
	opacity: 1;
	transform: translate(0, -50%) scale(1);
}

@keyframes tag-r {
	0%   { transform: translate(-5px, 0); }
	50%  { transform: translate(6px, -1px); }
	100% { transform: translate(0, 0); }
}
@keyframes tag-b {
	0%   { transform: translate(5px, 1px); }
	50%  { transform: translate(-5px, 0); }
	100% { transform: translate(0, 0); }
}
@keyframes tag-clip {
	0%, 100% { clip-path: inset(0 0 0 0); }
	30%      { clip-path: inset(20% 0 30% 0); }
	60%      { clip-path: inset(45% 0 10% 0); }
}
@keyframes tag-fade {
	0%, 80% { opacity: 1; }
	100%    { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.logo.sleepy .dot { animation: none; }
	.logo.is-hover .ghost,
	.logo.is-hover .word-clip { animation: none; opacity: 0; }
	.logo .br { transition: none; }
}

.kicker {
	font-family: var(--font-display);
	font-size: 1.05rem;
	color: var(--muted);
	margin-top: 0.45rem;
	font-variation-settings: "opsz" 14;
}
.kicker em { font-style: italic; color: var(--text-soft); }

.masthead-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.55rem;
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--muted);
	white-space: nowrap;
}

.status {
	letter-spacing: 0.08em;
	text-transform: lowercase;
	color: var(--muted);
	display: inline-block;
	padding: 0.1rem 0;
}
.status.ok { color: var(--fresh); }
.status.err { color: var(--alarm); }
.status.loading { color: var(--accent); }
.status.loading::after {
	content: " ●";
	animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
	0%, 100% { opacity: 0.3; }
	50% { opacity: 1; }
}

.masthead-actions {
	display: flex;
	align-items: center;
	gap: 0.45rem;
}

.text-btn {
	background: transparent;
	border: none;
	color: var(--muted);
	font-family: var(--font-mono);
	font-size: 0.78rem;
	cursor: pointer;
	padding: 0;
	letter-spacing: 0.04em;
	transition: color 140ms;
	font-weight: 400;
}
.text-btn:hover { color: var(--accent); }
.text-btn.primary { color: var(--text); }
.text-btn.primary:hover { color: var(--accent); }

.dot-sep { color: var(--muted-deep); user-select: none; }

/* ───── FILTER BAR ───── */
.filter-bar {
	display: flex;
	align-items: baseline;
	gap: 0.9rem;
	padding: 0.5rem 0 0.55rem;
	border-bottom: 1px solid var(--hairline);
	font-family: var(--font-mono);
	font-size: 0.85rem;
}

.filter-label {
	color: var(--muted);
	font-size: 0.68rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

#filter {
	flex: 1;
	background: transparent;
	border: none;
	color: var(--text);
	font: inherit;
	font-family: var(--font-mono);
	outline: none;
	padding: 0.15rem 0;
	caret-color: var(--accent);
}
#filter::placeholder {
	color: var(--muted-deep);
	font-style: italic;
}

.filter-count {
	color: var(--muted);
	font-size: 0.74rem;
	letter-spacing: 0.06em;
}

/* ───── SECTIONS ───── */
.section-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 0.6rem 0 0.5rem;
	border-bottom: 1px solid var(--hairline);
	margin-top: 0.5rem;
}

.section-label {
	font-family: var(--font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--muted);
	font-weight: 400;
	margin: 0;
}

.section-meta {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--muted-deep);
	letter-spacing: 0.06em;
}

/* ───── FEED ───── */
.feed-section { margin-bottom: 2.25rem; }

.feed { display: flex; flex-direction: column; }

.feed-item {
	display: grid;
	grid-template-columns: 1.5rem 1fr auto;
	gap: 0.75rem;
	padding: 0.55rem 0.5rem 0.55rem 0;
	border-bottom: 1px solid var(--hairline);
	text-decoration: none;
	color: inherit;
	align-items: center;
	transition: background 180ms ease, padding-left 180ms ease;
	position: relative;
	opacity: 0;
	animation: rowIn 360ms cubic-bezier(0.2, 0.6, 0.1, 1) forwards;
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: var(--paper); padding-left: 0.6rem; }

.feed-icon {
	font-family: var(--font-mono);
	font-size: 0.95rem;
	color: var(--muted);
	text-align: center;
	user-select: none;
	transition: color 180ms;
}
.feed-item.feed-push     .feed-icon { color: var(--text-soft); }
.feed-item.feed-release  .feed-icon { color: var(--accent); }
.feed-item.feed-prerelease .feed-icon { color: var(--accent-soft); }
.feed-item.feed-pr-opened  .feed-icon { color: var(--fresh); }
.feed-item.feed-pr-merged  .feed-icon { color: var(--accent); }
.feed-item.feed-pr-closed  .feed-icon { color: var(--muted-deep); }

.feed-text {
	font-family: var(--font-mono);
	font-size: 0.82rem;
	color: var(--text-soft);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}

.feed-text .feed-actor {
	color: var(--text);
	font-weight: 500;
}
.feed-text .feed-verb {
	font-family: var(--font-display);
	font-style: italic;
	font-size: 0.95rem;
	color: var(--muted);
	font-variation-settings: "opsz" 14;
	font-weight: 350;
	margin: 0 0.15em;
}
.feed-text .feed-detail {
	color: var(--text);
}
.feed-text .feed-quote {
	font-family: var(--font-display);
	font-style: italic;
	color: var(--text-soft);
	font-size: 0.92rem;
	font-weight: 350;
}
.feed-text .feed-repo {
	color: var(--accent-soft);
}
.feed-item:hover .feed-repo { color: var(--accent); }

.feed-time {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	color: var(--muted);
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.feed-empty,
.feed-loading {
	font-family: var(--font-display);
	font-style: italic;
	color: var(--muted);
	font-size: 1rem;
	padding: 1.5rem 0.5rem;
	font-variation-settings: "opsz" 18;
}

/* ───── REPO LIST SECTION (collapsible) ───── */
.repo-section { margin-top: 1rem; }

.repo-section > summary {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	cursor: pointer;
	padding: 0.6rem 0 0.55rem;
	border-bottom: 1px solid var(--hairline);
	list-style: none;
	gap: 0.75rem;
	user-select: none;
}
.repo-section > summary::-webkit-details-marker { display: none; }
.repo-section > summary:hover .summary-toggle { color: var(--accent); }

.summary-toggle {
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--muted);
	letter-spacing: 0.08em;
	transition: color 160ms;
	margin-left: auto;
}
.summary-toggle::after { content: "[ collapse ]"; }
.repo-section:not([open]) .summary-toggle::after { content: "[ expand ]"; }

/* ───── LIST ROWS ───── */
.list { display: flex; flex-direction: column; line-height: 1.3; }

.row {
	display: grid;
	grid-template-columns: 2.25rem 1fr auto;
	gap: 1rem;
	min-height: 2.2rem;
	padding: 0.35rem 0.5rem 0.35rem 0;
	border-bottom: 1px solid var(--hairline);
	transition: background 200ms ease, padding-left 200ms ease;
	position: relative;
	opacity: 0;
	animation: rowIn 380ms cubic-bezier(0.2, 0.6, 0.1, 1) forwards;
	align-items: center;
	line-height: 1;
}
.row.hidden { display: none; }
.row:last-child { border-bottom: none; }
.row > * { line-height: 1; }

@keyframes rowIn {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.row::before {
	content: "";
	position: absolute;
	left: -0.6rem;
	top: 50%;
	transform: translateY(-50%) scaleY(0);
	transform-origin: center;
	width: 2px;
	height: 65%;
	background: var(--accent);
	transition: transform 200ms cubic-bezier(0.2, 0.6, 0.1, 1);
}

.row:hover {
	background: var(--paper);
	padding-left: 0.7rem;
}
.row:hover::before { transform: translateY(-50%) scaleY(1); }

.row-index {
	font-family: var(--font-display);
	font-size: 0.95rem;
	font-style: italic;
	font-weight: 300;
	color: var(--muted);
	font-variation-settings: "opsz" 14;
	letter-spacing: -0.02em;
	transition: color 220ms;
	user-select: none;
	line-height: 1;
}

/* Recency tinting on the index numeral */
.row[data-recency="hot"]  .row-index { color: var(--accent); }
.row[data-recency="warm"] .row-index { color: var(--accent-soft); }
.row[data-recency="cool"] .row-index { color: var(--text-soft); }
.row[data-recency="cold"] .row-index { color: var(--muted-deep); }

.row-heading {
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	line-height: 1;
}

.row-name {
	font-family: var(--font-mono);
	font-size: 0.95rem;
	font-weight: 400;
	color: var(--text);
	text-decoration: none;
	letter-spacing: -0.005em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: color 150ms;
	flex-shrink: 0;
	max-width: 100%;
}
.row-name:hover { color: var(--accent); }

.row-arrow {
	color: var(--muted-deep);
	font-size: 0.78rem;
	transition: color 180ms, transform 180ms;
	font-family: var(--font-mono);
}
.row:hover .row-arrow { color: var(--accent); transform: translate(2px, -2px); }

.row-sep[hidden] { display: none; }
.row-sep {
	color: var(--muted-deep);
	font-family: var(--font-mono);
	font-size: 0.78rem;
}

.row-desc {
	font-family: var(--font-display);
	font-style: italic;
	font-size: 0.92rem;
	color: var(--muted);
	font-variation-settings: "opsz" 14;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 350;
	min-width: 0;
}

.row-release {
	display: flex;
	align-items: baseline;
	gap: 0.4rem;
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--muted);
	white-space: nowrap;
	line-height: 1;
}

.row-tag {
	color: var(--text-soft);
	letter-spacing: -0.005em;
}
.row-tag.empty {
	color: var(--muted-deep);
	font-style: italic;
	font-family: var(--font-mono);
	padding: 0;
}
.row-tag.commit {
	color: var(--muted);
	font-style: italic;
	font-family: var(--font-mono);
	font-size: 0.78rem;
	max-width: 28ch;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.row-age { color: var(--muted); }

.row-pre {
	font-size: 0.62rem;
	letter-spacing: 0.18em;
	color: var(--accent-soft);
	border: 1px solid var(--accent-soft);
	padding: 0.05em 0.35em;
	border-radius: 1px;
	text-transform: uppercase;
	margin: 0 0.1rem;
}
.row-pre[hidden] { display: none; }

.row-download {
	color: var(--accent);
	text-decoration: none;
	border-bottom: 1px dashed transparent;
	padding-bottom: 1px;
	transition: border-color 160ms, color 160ms;
	margin-left: 0.35rem;
	font-weight: 500;
}
.row-download:hover { border-bottom-color: var(--accent); }
.row-download[hidden] { display: none; }

/* ───── EMPTY / ERROR ───── */
.empty {
	padding: 5rem 1rem;
	text-align: center;
	color: var(--muted);
	font-family: var(--font-display);
	font-style: italic;
	font-size: 1.3rem;
	font-weight: 300;
	font-variation-settings: "opsz" 48;
	line-height: 1.4;
}
.empty a { color: var(--accent); text-decoration: none; border-bottom: 1px dashed var(--accent-soft); }
.empty code {
	font-family: var(--font-mono);
	font-style: normal;
	font-size: 0.95rem;
	color: var(--text);
}

/* ───── COLOPHON ───── */
.colophon {
	margin-top: 4rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--hairline);
	font-family: var(--font-mono);
	font-size: 0.7rem;
	color: var(--muted-deep);
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
	letter-spacing: 0.06em;
}
.colophon em { color: var(--muted); font-family: var(--font-display); font-style: italic; font-size: 0.95em; }
.colophon a { color: var(--muted); text-decoration: none; }
.colophon a:hover { color: var(--accent); }

/* ───── DIALOG ───── */
dialog {
	background: var(--paper-warm);
	color: var(--text);
	border: 1px solid var(--hairline);
	border-radius: 0;
	padding: 2.25rem 2.5rem;
	max-width: 540px;
	width: 90vw;
	font-family: var(--font-display);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
	position: relative;
}
dialog::backdrop {
	background: rgba(8, 6, 4, 0.85);
	backdrop-filter: blur(4px);
}

/* corner ornaments — small marks at the dialog's four corners, like an old form */
dialog::before, dialog::after {
	content: "";
	position: absolute;
	width: 14px;
	height: 14px;
	border-color: var(--accent);
	border-style: solid;
	pointer-events: none;
}
dialog::before {
	top: 8px; left: 8px;
	border-width: 1px 0 0 1px;
}
dialog::after {
	bottom: 8px; right: 8px;
	border-width: 0 1px 1px 0;
}

dialog h2 {
	font-style: italic;
	font-weight: 300;
	font-size: 2.2rem;
	font-variation-settings: "opsz" 96;
	margin-bottom: 0.6rem;
	letter-spacing: -0.025em;
	line-height: 1.05;
}
dialog h2 em { font-style: italic; }

dialog p {
	font-size: 0.95rem;
	color: var(--muted);
	margin-bottom: 1.4rem;
	line-height: 1.55;
	font-variation-settings: "opsz" 14;
	font-weight: 350;
}
dialog p code {
	font-family: var(--font-mono);
	font-size: 0.82em;
	color: var(--accent-soft);
	background: var(--bg);
	padding: 0.1em 0.4em;
}
dialog a { color: var(--accent); text-decoration: none; border-bottom: 1px dashed var(--accent-soft); }
dialog a:hover { border-bottom-style: solid; }

dialog input {
	width: 100%;
	background: var(--bg);
	border: none;
	border-bottom: 1px solid var(--hairline);
	color: var(--text);
	padding: 0.65rem 0;
	font-family: var(--font-mono);
	font-size: 0.95rem;
	margin-bottom: 1.4rem;
	transition: border-color 220ms;
	caret-color: var(--accent);
}
dialog input:focus {
	outline: none;
	border-bottom-color: var(--accent);
}

.dialog-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--font-mono);
	font-size: 0.85rem;
}

/* ───── MOBILE ───── */
@media (max-width: 720px) {
	.masthead { flex-direction: column; align-items: flex-start; gap: 1rem; }
	.masthead-meta { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 0.6rem; }
	.row { grid-template-columns: 2.25rem 1fr; gap: 0.8rem; padding-right: 0.25rem; }
	.row-release {
		grid-column: 2;
		padding-top: 0.3rem;
		font-size: 0.78rem;
		flex-wrap: wrap;
	}
	.row:hover { padding-left: 0.4rem; }
	.colophon { flex-direction: column; gap: 0.25rem; }
}
