/* ==========================================================================
   TweetyProject — tweetyproject.org
   Single stylesheet for the single-page site.
   ========================================================================== */

:root {
	--bg:            #ffffff;
	--bg-alt:        #f6f7f9;
	--surface:       #ffffff;
	--surface-alt:   #f2f4f7;
	--text:          #16191f;
	--text-muted:    #5b6675;
	--border:        #e2e6eb;
	--border-strong: #ccd3db;
	/* Accent picked up from the AIG logo (blue) and its secondary tan. */
	--accent:        #2a5296;
	--accent-soft:   #ecf0f8;
	--accent-text:   #234780;
	--highlight:     #9c6a2c;
	--code-bg:       #f2f4f7;
	--shadow:        0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
	--radius:        12px;
	--maxw:          1120px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg:            #0e1116;
		--bg-alt:        #12161d;
		--surface:       #161b23;
		--surface-alt:   #1b2029;
		--text:          #e7eaef;
		--text-muted:    #9aa5b4;
		--border:        #262d38;
		--border-strong: #384252;
		--accent:        #6f9ad9;
		--accent-soft:   #161f2e;
		--accent-text:   #9dbbe6;
		--highlight:     #d8a262;
		--code-bg:       #11151c;
		--shadow:        0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
	}
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, pre, .mono {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	font-size: .875em;
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -.015em; }

.wrap {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 0 24px;
}

/* --- Header ---------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--border);
}

.site-header .wrap {
	display: flex;
	align-items: center;
	gap: 20px;
	min-height: 60px;
	flex-wrap: wrap;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 650;
	color: var(--text);
	letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
/* The bird is black on transparent, so it needs its own light ground to stay
   legible in dark mode — and the ring keeps it a deliberate mark in light mode. */
.brand img {
	width: 34px;
	height: 34px;
	padding: 1px;
	background: #555;
	border: 1px solid var(--border);
	border-radius: 50%;
}

.nav {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-left: auto;
	flex-wrap: wrap;
}

.nav a {
	color: var(--text-muted);
	padding: 6px 10px;
	border-radius: 8px;
	font-size: .9rem;
	font-weight: 500;
}
.nav a:hover {
	color: var(--text);
	background: var(--surface-alt);
	text-decoration: none;
}

/* --- Hero ------------------------------------------------------------------ */

.hero {
	padding: 72px 0 56px;
	border-bottom: 1px solid var(--border);
	background:
		radial-gradient(900px 380px at 15% -10%, var(--accent-soft), transparent 70%),
		var(--bg);
}

.hero h1 {
	margin: 0 0 12px;
	font-size: clamp(2.1rem, 5vw, 3.1rem);
	font-weight: 700;
}

.hero .lede {
	margin: 0 0 28px;
	font-size: clamp(1.05rem, 2vw, 1.2rem);
	color: var(--text-muted);
	max-width: 62ch;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 12px;
	margin-bottom: 20px;
	border: 1px solid var(--border-strong);
	border-radius: 999px;
	background: var(--surface);
	font-size: .82rem;
	color: var(--text-muted);
}
.pill strong { color: var(--text); font-weight: 600; }

.hero-grid {
	display: grid;
	grid-template-columns: 1.15fr .85fr;
	gap: 40px;
	align-items: start;
}

@media (max-width: 820px) {
	.hero-grid { grid-template-columns: 1fr; gap: 32px; }
	.hero { padding: 48px 0 40px; }
}

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 10px;
	border: 1px solid var(--border-strong);
	background: var(--surface);
	color: var(--text);
	font-size: .94rem;
	font-weight: 550;
	cursor: pointer;
	transition: transform .12s ease, border-color .12s ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }

.btn-primary {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }

/* --- Code block ------------------------------------------------------------ */

.code {
	position: relative;
	background: var(--code-bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.code-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 10px 8px 14px;
	border-bottom: 1px solid var(--border);
	background: var(--surface-alt);
	font-size: .78rem;
	color: var(--text-muted);
	letter-spacing: .02em;
	text-transform: uppercase;
}

.code pre {
	margin: 0;
	padding: 16px;
	overflow-x: auto;
	line-height: 1.55;
}

.copy-btn {
	border: 1px solid var(--border-strong);
	background: var(--surface);
	color: var(--text-muted);
	border-radius: 7px;
	padding: 3px 10px;
	font: inherit;
	font-size: .78rem;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }

.code-note { margin: 12px 2px 0; font-size: .86rem; }
.code-note a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--text-muted);
}
.code-note a:hover { color: var(--accent-text); text-decoration: none; }
.code-note svg { flex: none; color: var(--highlight); }

/* A .code box that is itself a link (AgonProject). */
.codelink {
	display: block;
	margin-top: 18px;
	color: var(--text);
	transition: border-color .14s ease, transform .14s ease;
}
.codelink:hover {
	text-decoration: none;
	border-color: var(--accent);
	transform: translateY(-1px);
}
.codelink .code-head { display: flex; }
.code-open { color: var(--accent-text); font-weight: 600; }

.codelink-body { display: block; padding: 16px; }
.codelink-url {
	display: block;
	margin-bottom: 6px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .84rem;
	color: var(--text);
}
.codelink-text { display: block; font-size: .88rem; color: var(--text-muted); }

/* --- Sections -------------------------------------------------------------- */

section { padding: 64px 0; border-bottom: 1px solid var(--border); }
section:target, .anchor { scroll-margin-top: 76px; }
section.alt { background: var(--bg-alt); }

.section-head { max-width: 68ch; margin-bottom: 36px; }
.section-head p { margin: 0; color: var(--text-muted); }

/* Sections are titled by the eyebrow alone. */
.eyebrow {
	display: block;
	margin: 0 0 12px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--accent);
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--accent-text);
	max-width: max-content;
	padding-right: 40px;
}


/* --- Libraries ------------------------------------------------------------- */

.lib-filter {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 30px;
}

.lib-filter input {
	flex: 1 1 320px;
	max-width: 460px;
	padding: 10px 16px;
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border-strong);
	border-radius: 10px;
	font: inherit;
	font-size: .94rem;
}
.lib-filter input:focus {
	outline: 2px solid var(--accent);
	outline-offset: -1px;
	border-color: var(--accent);
}
.lib-filter input::placeholder { color: var(--text-muted); opacity: .85; }

.lib-count { font-size: .86rem; color: var(--text-muted); }

.lib-empty {
	margin: 0 0 30px;
	color: var(--text-muted);
	font-size: .95rem;
}

.lib-group { margin-bottom: 44px; }
.lib-group:last-child { margin-bottom: 0; }

.lib-group > h3 {
	margin: 0 0 16px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--border);
	font-size: 1.12rem;
	font-weight: 650;
	display: flex;
	align-items: baseline;
	gap: 10px;
}
.lib-group > h3 .count {
	font-size: .8rem;
	font-weight: 500;
	color: var(--text-muted);
}

.lib-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
	gap: 14px;
}

.lib {
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px 18px;
	transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.lib:hover {
	border-color: var(--border-strong);
	transform: translateY(-2px);
	box-shadow: var(--shadow);
}

.lib h4 {
	margin: 0 0 4px;
	font-size: 1rem;
	font-weight: 640;
}

.lib .pkg {
	display: block;
	margin-bottom: 10px;
	color: var(--text-muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .78rem;
	word-break: break-all;
}

.lib p { margin: 0; font-size: .92rem; color: var(--text-muted); }
/* The description takes the slack, so the coordinate box and the links sit on
   the bottom edge across a row of cards of differing length. */
.lib > p:not([class]) { margin-bottom: 12px; }

.lib-maven {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	margin-top: auto !important;
	padding: 3px 4px 3px 10px;
	min-height: 32px;
	background: var(--surface-alt);
	border: 1px solid var(--border);
	border-radius: 8px;
}
.lib-maven code {
	color: var(--text);
	font-size: .78rem;
	line-height: 1.45;
	word-break: break-all;
}

.mini-copy {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border: none;
	border-radius: 6px;
	background: none;
	color: var(--text-muted);
	cursor: pointer;
}
.mini-copy:hover { color: var(--accent-text); background: var(--surface); }
.mini-copy svg { width: 14px; height: 14px; }

/* Hover/focus preview of the exact snippet the button copies. */
.dep-preview {
	position: absolute;
	right: 0;
	bottom: calc(100% + 10px);
	z-index: 20;
	padding: 12px 14px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: 10px;
	box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .45);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .72rem;
	line-height: 1.55;
	color: var(--text);
	white-space: pre;
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity .12s ease, transform .12s ease, visibility .12s;
	pointer-events: none;
}

.mini-copy:hover + .dep-preview,
.mini-copy:focus-visible + .dep-preview {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.lib-links {
	display: flex;
	gap: 8px;
	margin-top: 14px !important;
	padding-top: 12px;
	border-top: 1px solid var(--border);
}
.lib-links a {
	padding: 3px 12px;
	border: 1px solid var(--border-strong);
	border-radius: 7px;
	font-size: .8rem;
	font-weight: 550;
	color: var(--text-muted);
}
.lib-links a:hover {
	color: var(--accent-text);
	border-color: var(--accent);
	background: var(--accent-soft);
	text-decoration: none;
}


.tag {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--highlight);
	border: 1px solid var(--border);
	font-size: .68rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	vertical-align: middle;
}

/* --- Generic content lists ------------------------------------------------- */

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 16px;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px 22px;
}
.card h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 640; }
.card p { margin: 0 0 12px; color: var(--text-muted); font-size: .94rem; }
.card p:last-child { margin-bottom: 0; }

.ref {
	border-left: 3px solid var(--accent);
	padding: 2px 0 2px 18px;
	margin: 0 0 22px;
}
.ref:last-of-type { margin-bottom: 0; }
.ref .cite { display: block; margin-bottom: 8px; }
.ref .links { display: flex; gap: 10px; font-size: .86rem; }
.ref .links a {
	border: 1px solid var(--border-strong);
	border-radius: 7px;
	padding: 2px 10px;
	color: var(--text-muted);
}
.ref .links a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }

.news { list-style: none; margin: 0; padding: 0; }
.news > li {
	padding: 0 0 22px 22px;
	border-left: 2px solid var(--border);
	position: relative;
}
.news > li:last-child { padding-bottom: 0; }
.news > li::before {
	content: "";
	position: absolute;
	left: -6px;
	top: 9px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--accent);
}
.news .date {
	display: block;
	font-size: .8rem;
	color: var(--text-muted);
	letter-spacing: .03em;
}
.news h3 { margin: 2px 0 6px; font-size: 1.02rem; font-weight: 640; }
.news ul { margin: 0; padding-left: 20px; color: var(--text-muted); font-size: .93rem; }


.prose { max-width: 72ch; }
.prose p { margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; }
.muted { color: var(--text-muted); }

details.terms {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	padding: 0;
}
details.terms > summary {
	cursor: pointer;
	padding: 14px 20px;
	font-weight: 600;
	list-style: none;
}
details.terms > summary::-webkit-details-marker { display: none; }
details.terms > summary::after { content: " ▸"; color: var(--text-muted); }
details.terms[open] > summary::after { content: " ▾"; }
details.terms > summary:hover { color: var(--accent-text); }
.terms-body {
	padding: 4px 20px 20px;
	border-top: 1px solid var(--border);
	font-size: .92rem;
	color: var(--text-muted);
	max-width: 78ch;
}
.terms-body h4 { margin: 18px 0 6px; color: var(--text); font-size: .95rem; }
.terms-body h4:first-child { margin-top: 12px; }

/* --- Footer ---------------------------------------------------------------- */

.site-footer { padding: 44px 0 56px; }

.footer-grid {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
}

.logos { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.logos img { height: 70px; width: auto; }
/* The AIG logo artwork is drawn for a light ground; lift it in dark mode. */
@media (prefers-color-scheme: dark) {
	.logos img { background: #fff; padding: 5px 8px; border-radius: 8px; }
}

.footer-meta { font-size: .85rem; color: var(--text-muted); text-align: right; }
.footer-meta a { color: var(--text-muted); text-decoration: underline; }

@media (max-width: 640px) {
	.footer-grid { justify-content: flex-start; }
	.footer-meta { text-align: left; }
	.nav { gap: 0; }
	.nav a { padding: 6px 8px; font-size: .84rem; }
	section { padding: 48px 0; }
}
