@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&display=swap");

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
	--background: 240 10% 8%;
	--foreground: 0 0% 98%;
	--card: 240 10% 10%;
	--card-foreground: 0 0% 98%;
	--popover: 240 10% 10%;
	--popover-foreground: 0 0% 98%;
	--primary: 0 0% 98%;
	--primary-foreground: 240 5.9% 10%;
	--secondary: 240 3.7% 15.9%;
	--secondary-foreground: 0 0% 98%;
	--muted: 240 3.7% 15.9%;
	--muted-foreground: 240 5% 64.9%;
	--accent: 240 3.7% 15.9%;
	--accent-foreground: 0 0% 98%;
	--destructive: 0 75% 45%;
	--destructive-foreground: 0 0% 98%;
	--border: 240 3.7% 15.9%;
	--input: 240 3.7% 15.9%;
	--ring: 240 4.9% 83.9%;
	--radius: 0.5rem;
	--code-background: hsl(240 10% 10%);
	--code-foreground: hsl(0 0% 98%);
	--code-keyword: #c678dd;
	--code-class: #98c379;
	--code-function: #61afef;
	--code-string: #98c379;
	--code-comment: hsl(240 5% 64.9%);
	--code-operator: #56b6c2;
	--code-punctuation: hsl(240 5% 64.9%);
}

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

html,
body,
#root {
	height: 100%;
	overflow: hidden;
	background: transparent;
}

body {
	font-family: "IBM Plex Mono", monospace;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	color: rgba(255, 255, 255, 0.9);
	overscroll-behavior: none;
	user-select: none;
}

/* macOS-style overlay scrollbars: only visible while scrolling */
* {
	scrollbar-width: thin;
	scrollbar-color: transparent transparent;
}

.is-scrolling {
	scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

::-webkit-scrollbar {
	width: 10px;
	height: 10px;
	background: transparent;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-track-piece {
	background: transparent;
	border: none;
}

::-webkit-scrollbar-thumb {
	background-color: transparent;
	border-radius: 10px;
	border: 2px solid transparent;
	background-clip: padding-box;
	min-height: 24px;
	transition: background-color 400ms ease;
}

.is-scrolling::-webkit-scrollbar-thumb {
	background-color: rgba(255, 255, 255, 0.35);
	background-clip: padding-box;
	transition: background-color 80ms ease;
}

.is-scrolling::-webkit-scrollbar-thumb:hover {
	background-color: rgba(255, 255, 255, 0.5);
	background-clip: padding-box;
}

.is-scrolling::-webkit-scrollbar-thumb:active {
	background-color: rgba(255, 255, 255, 0.65);
	background-clip: padding-box;
}

::-webkit-scrollbar-corner,
::-webkit-scrollbar-button {
	background: transparent;
	display: none;
}

.markdown-content {
	max-width: 100%;
	overflow-wrap: break-word;
	word-wrap: break-word;
	word-break: break-word;
}

.markdown-content h1 {
	font-size: 1.5rem;
	font-weight: 700;
	margin-top: 1rem;
	margin-bottom: 0.5rem;
}

.markdown-content h2 {
	font-size: 1.25rem;
	font-weight: 600;
	margin-top: 1rem;
	margin-bottom: 0.5rem;
}

.markdown-content h3 {
	font-size: 1.125rem;
	font-weight: 600;
	margin-top: 0.75rem;
	margin-bottom: 0.25rem;
}

.markdown-content p {
	margin-top: 0.5rem;
	margin-bottom: 0.5rem;
}

.markdown-content ul,
.markdown-content ol {
	margin-top: 0.5rem;
	margin-bottom: 0.5rem;
	padding-left: 1.5rem;
}

.markdown-content li {
	margin-top: 0.125rem;
	margin-bottom: 0.125rem;
}

.markdown-content pre {
	background-color: var(--code-background);
	border: 1px solid hsl(var(--border));
	border-radius: 0.5rem;
	padding: 0.75rem;
	margin-top: 0.5rem;
	margin-bottom: 0.5rem;
	overflow-x: auto;
	color: var(--code-foreground);
}

.markdown-content code {
	background-color: var(--code-background);
	border: 1px solid hsl(var(--border));
	border-radius: 0.25rem;
	padding: 0.125rem 0.375rem;
	font-size: 0.875rem;
	color: var(--code-foreground);
}

.markdown-content pre code {
	background-color: transparent;
	border: none;
	padding: 0;
	font-size: 0.875rem;
	color: inherit;
}

.markdown-content blockquote {
	border-left: 4px solid hsl(var(--border));
	padding-left: 1rem;
	margin-top: 0.5rem;
	margin-bottom: 0.5rem;
	color: hsl(var(--muted-foreground));
	font-style: italic;
}

.markdown-content a {
	color: hsl(var(--primary));
	text-decoration: underline;
}

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

.markdown-content > *:last-child {
	margin-bottom: 0;
}

.code-with-line-numbers {
	counter-reset: line-number;
}

.code-with-line-numbers .code-line {
	counter-increment: line-number;
	display: flex !important;
	align-items: flex-start;
}

.code-with-line-numbers .code-line::before {
	content: counter(line-number);
	min-width: 3em;
	padding-right: 1em;
	text-align: right;
	color: hsl(var(--muted-foreground) / 0.5);
	font-size: 0.7rem;
	flex-shrink: 0;
	user-select: none;
	pointer-events: none;
}
