/*
 * _base.css — Global design tokens, element defaults, page shell, and tiny utilities.
 * ALWAYS included in every page.
 *
 * Provides:
 *   :root variables (light + dark), box-sizing, html/body,
 *   element defaults (button, input, select, textarea, label, fieldset, legend,
 *   a, hr, img, h1-h4, p, ul/ol/li, blockquote, table/th/td, details/summary,
 *   pre/code), main / .notion-shell, utility classes, .notion-footer,
 *   reduced-motion and responsive breakpoints for base elements.
 */

:root {
	color-scheme: light dark;
	--notion-bg: #ffffff;
	--notion-bg-soft: #f9f9f8;
	--notion-surface: #ffffff;
	--notion-surface-hover: #f6f5f4;
	--notion-text: #191918;
	--notion-text-soft: rgba(0, 0, 0, 0.54);
	--notion-text-faint: rgba(0, 0, 0, 0.3);
	--notion-border: rgba(0, 0, 0, 0.1);
	--notion-border-soft: rgba(0, 0, 0, 0.05);
	--notion-shadow:
		0px 0.7px 1.462px rgba(0, 0, 0, 0.015), 0px 3px 9px rgba(0, 0, 0, 0.03);
	--notion-blue: #2783de;
	--notion-orange: #d5803b;
	--notion-red: #e56458;
	--notion-blue-bg: #f3f9fd;
	--notion-yellow-bg: #fcfaef;
	--notion-orange-bg: #fcf7f4;
	--notion-green-bg: #f6f9f7;
	--notion-red-bg: #fdf6f6;
	--notion-gray-bg: #f9f8f7;
	--notion-radius: 8px;
	--notion-page-width: 900px;
	--notion-chart-1: #5e9fe8;
	--notion-chart-2: #eac26b;
	--notion-chart-3: #72bc8f;
	--notion-chart-4: #bf8eda;
	--notion-chart-5: #de9255;
	--notion-chart-6: #df84a8;
	--notion-chart-7: #4fb9c9;
	--notion-chart-8: #e97366;
	--diff-add: #47c1b6;
	--diff-del: #f07070;
	--pr-approved: #2b8a3e;
}

@media (prefers-color-scheme: dark) {
	:root {
		--notion-bg: #000000;
		--notion-bg-soft: #191918;
		--notion-surface: #191918;
		--notion-surface-hover: #31302e;
		--notion-text: #ffffff;
		--notion-text-soft: rgba(255, 255, 255, 0.5);
		--notion-text-faint: rgba(255, 255, 255, 0.3);
		--notion-border: rgba(255, 255, 255, 0.2);
		--notion-border-soft: rgba(255, 255, 255, 0.1);
		--notion-shadow:
			0px 0.7px 1.462px rgba(0, 0, 0, 0.06), 0px 3px 9px rgba(0, 0, 0, 0.12);
		--notion-blue: #5e9fe8;
		--notion-orange: #de9255;
		--notion-red: #e97366;
		--notion-blue-bg: rgba(41, 139, 253, 0.061);
		--notion-yellow-bg: rgba(203, 145, 47, 0.08);
		--notion-orange-bg: rgba(246, 126, 35, 0.08);
		--notion-green-bg: rgba(42, 157, 118, 0.08);
		--notion-red-bg: rgba(246, 73, 50, 0.08);
		--notion-gray-bg: #31302e;
		--diff-add: #5dd8cb;
		--diff-del: #ff8a80;
		--pr-approved: #69db7c;
	}
}

* {
	box-sizing: border-box;
}
html {
	scroll-behavior: smooth;
}
body {
	margin: 0;
	background: var(--notion-bg);
	color: var(--notion-text);
	font-family:
		ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
		"Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
	font-size: 16px;
	line-height: 1.5;
	transition:
		background 180ms ease,
		color 180ms ease;
}

/* -- Base element defaults -------------------------------- */
button,
[type="button"],
[type="submit"],
[type="reset"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 8px 16px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	color: #ffffff;
	background: var(--notion-blue);
	border: 1px solid transparent;
	border-radius: 8px;
	cursor: pointer;
	transition: background 150ms;
	white-space: nowrap;
}
button:hover,
[type="button"]:hover,
[type="submit"]:hover,
[type="reset"]:hover {
	background: color-mix(in srgb, var(--notion-blue) 82%, black);
}
button:focus-visible,
[type="button"]:focus-visible,
[type="submit"]:focus-visible,
[type="reset"]:focus-visible {
	outline: 2px solid var(--notion-blue);
	outline-offset: 2px;
}

input,
select,
textarea {
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	color: var(--notion-text);
	background: var(--notion-surface);
	border: 1px solid var(--notion-border);
	border-radius: 8px;
	padding: 8px 12px;
	transition: border-color 150ms;
}
input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--notion-blue);
	box-shadow: 0 0 0 2px rgba(9, 127, 232, 0.15);
}
input::placeholder,
textarea::placeholder {
	color: var(--notion-text-faint);
}
select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	padding-right: 30px;
}
textarea {
	resize: vertical;
	min-height: 80px;
}
input[type="range"] {
	border: none;
	padding: 0;
	background: transparent;
	accent-color: var(--notion-blue);
	height: 18px;
	cursor: pointer;
	box-shadow: none;
}
input[type="range"]:focus {
	box-shadow: none;
}
input[type="checkbox"],
input[type="radio"] {
	width: 16px;
	height: 16px;
	accent-color: var(--notion-blue);
	border: 1px solid var(--notion-border);
	padding: 0;
	cursor: pointer;
}
label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--notion-text);
	margin-bottom: 6px;
}
fieldset {
	border: 1px solid var(--notion-border-soft);
	border-radius: 10px;
	padding: 16px;
	margin: 0;
}
legend {
	font-weight: 600;
	padding: 0 4px;
}

a {
	color: var(--notion-text);
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-color: var(--notion-border);
}
a:hover {
	text-decoration-color: var(--notion-text);
}

hr {
	height: 1px;
	margin: 34px 0;
	border: none;
	background: var(--notion-border-soft);
}

img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

h1,
h2,
h3,
h4 {
	text-wrap: balance;
}
h1 {
	margin: 0 0 14px;
	font-size: clamp(42px, 7vw, 72px);
	line-height: 1.1;
	letter-spacing: -0.035em;
	font-weight: 700;
}
h2 {
	margin: 44px 0 10px;
	font-size: 32px;
	line-height: 1.25;
	letter-spacing: -0.025em;
}
h3 {
	margin: 0 0 6px;
	font-size: 18px;
	line-height: 1.556;
	letter-spacing: -0.007em;
}
p {
	margin: 0 0 10px;
}

ul,
ol {
	margin: 8px 0 16px;
	padding-left: 24px;
}
li {
	margin-bottom: 4px;
}
li::marker {
	color: var(--notion-text-faint);
}

blockquote {
	border-left: 3px solid var(--notion-text);
	padding: 4px 0 4px 16px;
	margin: 24px 0;
}
blockquote p {
	font-size: 18px;
	line-height: 1.5;
	margin: 0;
}

table {
	width: 100%;
	margin: 14px 0;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--notion-border-soft);
	border-radius: 10px;
	overflow: hidden;
	background: var(--notion-surface);
	font-size: 14px;
}
th,
td {
	padding: 12px 14px;
	vertical-align: top;
	text-align: left;
	border-right: 1px solid var(--notion-border-soft);
	border-bottom: 1px solid var(--notion-border-soft);
}
th:last-child,
td:last-child {
	border-right: 0;
}
tr:last-child td {
	border-bottom: 0;
}
th {
	background: var(--notion-bg-soft);
	color: var(--notion-text-soft);
	font-weight: 600;
}

details {
	margin: 16px 0;
	border-radius: var(--notion-radius);
}
summary {
	padding: 8px 10px;
	border-radius: var(--notion-radius);
	cursor: pointer;
	font-weight: 600;
}
summary:hover {
	background: var(--notion-surface-hover);
}
details p {
	margin: 8px 10px 0 28px;
	color: var(--notion-text-soft);
}

pre,
code {
	font-family: ui-monospace, "iA Writer Mono", Nitti, Menlo, Courier, monospace;
}
pre {
	margin: 16px 0;
	padding: 14px 16px;
	overflow-x: auto;
	border: 1px solid var(--notion-border-soft);
	border-radius: 10px;
	background: var(--notion-gray-bg);
	font-size: 13px;
	line-height: 1.55;
}
code {
	font-size: 0.9em;
	padding: 2px 5px;
	border-radius: 4px;
	background: var(--notion-gray-bg);
}
pre code {
	font-size: inherit;
	padding: 0;
	border-radius: 0;
	background: none;
}

main {
	max-width: var(--notion-page-width);
	margin: 0 auto;
	padding: 76px 24px 88px;
}

section {
	margin-top: 44px;
}
section:first-child {
	margin-top: 0;
}

/* -- Page shell ------------------------------------------- */
.notion-shell {
	max-width: var(--notion-page-width);
	margin: 0 auto;
	padding: 76px 24px 88px;
}

/* -- Tiny utilities --------------------------------------- */
.notion-lede {
	max-width: 720px;
	margin: 0 0 24px;
	color: var(--notion-text-soft);
	font-size: 20px;
}
.notion-muted {
	color: var(--notion-text-soft);
}
.notion-faint {
	color: var(--notion-text-faint);
}
.notion-divider {
	height: 1px;
	margin: 34px 0;
	background: var(--notion-border-soft);
}
.notion-eyebrow {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.0078125rem;
	text-transform: uppercase;
	color: var(--notion-blue);
}

/* -- Footer ----------------------------------------------- */
.notion-footer {
	margin-top: 52px;
	padding-top: 18px;
	border-top: 1px solid var(--notion-border-soft);
	color: var(--notion-text-faint);
	font-size: 13px;
}

/* -- Accessibility & motion ------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* -- Responsive: 560px (base elements) -------------------- */
@media (max-width: 560px) {
	main,
	.notion-shell {
		padding-inline: 16px;
	}
	table {
		display: block;
		overflow-x: auto;
	}
}
