/*
 * _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: #232320;
		--notion-bg-soft: #2c2c2a;
		--notion-surface: #323230;
		--notion-surface-hover: #3d3d3a;
		--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 {
	scrollbar-gutter: stable;
}
body {
	margin: 0;
	background: var(--notion-bg);
	color: var(--notion-text);
	font-family:
		ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
		Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
}

/* -- 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;
	}
}
/*
 * hero — Full-width hero section with title, subtitle, and optional eyebrow.
 *
 * HTML:
 * <section class="notion-hero">
 *   <span class="notion-eyebrow">Category</span>
 *   <h1>Page Title</h1>
 *   <p>A brief description that supports the title with additional context.</p>
 *   <div class="notion-button-group">
 *     <a class="notion-button" data-variant="primary" href="#">Get started</a>
 *     <a class="notion-button" data-variant="secondary" href="#">Learn more</a>
 *   </div>
 * </section>
 */

.notion-hero {
	padding: 48px 0 40px;
	max-width: var(--notion-page-width);
}
.notion-hero h1 {
	font-size: clamp(42px, 7vw, 72px);
	font-weight: 700;
	letter-spacing: -0.04em;
	line-height: 1.05;
	margin: 0;
	text-wrap: balance;
}
.notion-hero p {
	font-size: 20px;
	line-height: 1.5;
	color: var(--notion-text-soft);
	margin: 16px 0 0;
	max-width: 640px;
}
.notion-hero .notion-eyebrow {
	margin-bottom: 12px;
}

/* -- Responsive: 820px ------------------------------------ */
@media (max-width: 820px) {
	.notion-hero {
		padding: 32px 0 24px;
	}
	.notion-hero h1 {
		font-size: clamp(32px, 8vw, 48px);
	}
}
/*
 * callout — Highlighted info box with icon and text.
 * Options: data-tone="blue" | "green" | "orange" | "red" (default: yellow)
 *
 * HTML:
 * <div class="notion-callout" data-tone="blue">
 *   <div>💡</div>
 *   <div><strong>Note</strong><p>Helpful context.</p></div>
 * </div>
 */

.notion-callout {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 14px;
	margin: 18px 0;
	padding: 16px 18px;
	border-radius: var(--notion-radius);
	background: var(--notion-yellow-bg);
	border: 1px solid var(--notion-border-soft);
}
.notion-callout[data-tone="blue"] {
	background: var(--notion-blue-bg);
}
.notion-callout[data-tone="green"] {
	background: var(--notion-green-bg);
}
.notion-callout[data-tone="orange"] {
	background: var(--notion-orange-bg);
}
.notion-callout[data-tone="red"] {
	background: var(--notion-red-bg);
}
.notion-callout strong {
	display: block;
	margin-bottom: 3px;
}
.notion-callout p {
	margin: 0;
	color: var(--notion-text-soft);
}
/*
 * button — Styled link/button with variant and size options.
 * Options: data-variant="primary"|"secondary"|"tertiary"
 *          data-size="small"|"large"
 *
 * HTML:
 * <a class="notion-button" data-variant="primary" href="#">Primary</a>
 */

.notion-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	border-radius: 8px;
	border: 1px solid transparent;
	cursor: pointer;
	transition:
		background 150ms,
		box-shadow 150ms,
		border-color 150ms;
	text-decoration: none;
	font-family: inherit;
	white-space: nowrap;
}
.notion-button:focus-visible {
	outline: 2px solid var(--notion-blue);
	outline-offset: 2px;
}
/* Primary */
.notion-button[data-variant="primary"],
.notion-button:not([data-variant]) {
	background: var(--notion-blue);
	color: #ffffff;
	border-color: transparent;
}
.notion-button[data-variant="primary"]:hover,
.notion-button:not([data-variant]):hover {
	background: color-mix(in srgb, var(--notion-blue) 82%, black);
}
/* Secondary */
.notion-button[data-variant="secondary"] {
	background: var(--notion-blue-bg);
	color: var(--notion-blue);
	border-color: transparent;
}
.notion-button[data-variant="secondary"]:hover {
	background: color-mix(in srgb, var(--notion-blue-bg) 70%, var(--notion-blue));
}
/* Tertiary */
.notion-button[data-variant="tertiary"] {
	background: transparent;
	color: var(--notion-text);
	border-color: transparent;
}
.notion-button[data-variant="tertiary"]:hover {
	background: var(--notion-surface-hover);
}
/* Small modifier */
.notion-button[data-size="small"] {
	padding: 4px 12px;
	font-size: 12px;
}
/* Large modifier */
.notion-button[data-size="large"] {
	padding: 12px 24px;
	font-size: 16px;
}
.notion-button-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 24px;
}

/* -- Responsive: 820px ------------------------------------ */
@media (max-width: 820px) {
	.notion-button-group {
		flex-direction: column;
	}
	.notion-button-group .notion-button {
		width: 100%;
	}
}
/*
 * list — Numbered list with index badges and descriptions.
 *
 * HTML:
 * <div class="notion-list">
 *   <div class="notion-list-item">
 *     <div class="notion-index">1</div>
 *     <div>
 *       <h3>Item</h3>
 *       <p>Item details.</p>
 *     </div>
 *   </div>
 * </div>
 */

.notion-list {
	display: grid;
	gap: 8px;
	margin-top: 14px;
}
.notion-list-item {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 12px;
	padding: 12px 14px;
	border-radius: var(--notion-radius);
	background: transparent;
	transition: background 120ms ease;
}
.notion-list-item:hover {
	background: var(--notion-surface-hover);
}
.notion-index {
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 6px;
	background: var(--notion-blue-bg);
	color: var(--notion-blue);
	font-weight: 700;
	font-size: 14px;
}
.notion-list-item p {
	color: var(--notion-text-soft);
}
/*
 * quote — Styled blockquote with attribution (avatar, name, meta).
 *
 * HTML:
 * <blockquote class="notion-quote">
 *   <p>Design is not just what it looks like and feels like.
 *      Design is how it works.</p>
 *   <div class="notion-attribution">
 *     <img src="avatar.jpg" alt="">
 *     <div>
 *       <span class="notion-attribution-name">Steve Jobs</span>
 *       <span class="notion-attribution-meta">Apple, 2003</span>
 *     </div>
 *   </div>
 * </blockquote>
 */

.notion-quote {
	border-left: 3px solid var(--notion-text);
	padding: 4px 0 4px 16px;
	margin: 24px 0;
}
.notion-quote p {
	font-size: 18px;
	line-height: 1.5;
	color: var(--notion-text);
	margin: 0;
}
.notion-attribution {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
}
.notion-attribution img {
	width: 40px;
	height: 40px;
	border-radius: 9999px;
	object-fit: cover;
}
.notion-attribution-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--notion-text);
}
.notion-attribution-meta {
	font-size: 13px;
	color: var(--notion-text-faint);
}

/* ===== Dev log custom ===== */
.site-icon {
	object-fit: contain;
	border-radius: var(--notion-radius);
	flex-shrink: 0;
}
.site-icon--hero {
	width: clamp(36px, 6vw, 52px);
	height: clamp(36px, 6vw, 52px);
}
.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: calc(var(--notion-page-width) + 48px);
	margin: 0 auto;
	width: 100%;
	padding: 16px 24px;
	background: var(--notion-bg);
	border-bottom: 1px solid var(--notion-border-soft);
}
.page-home .site-header {
	justify-content: flex-end;
}
.site-header .brand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	text-decoration: none;
	color: var(--notion-text);
	letter-spacing: -0.01em;
	font-size: 16px;
}
.site-header .brand .site-icon {
	width: 22px;
	height: 22px;
}
.site-header nav { display: flex; gap: 18px; }
.site-header nav a { font-size: 14px; color: var(--notion-text-soft); text-decoration: none; }
.site-header nav a:hover { color: var(--notion-text); }

.post-list { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.post-list li { margin: 0; }
.post-list a.post-link {
	display: block; padding: 18px 20px; border-radius: var(--notion-radius);
	text-decoration: none; color: inherit;
	border: 1px solid var(--notion-border-soft); background: var(--notion-surface);
	transition: background 120ms ease, border-color 120ms ease;
}
.post-list a.post-link:hover { background: var(--notion-surface-hover); border-color: var(--notion-border); }
.post-list h3 { margin: 0 0 4px; }
.post-list p { margin: 0; color: var(--notion-text-soft); }
.post-list .post-meta { margin: 0 0 6px; }

.post-meta { font-size: 13px; color: var(--notion-text-faint); }
.post-article { max-width: 720px; }
.post-article h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 8px; }
.back-link { display: inline-block; margin-bottom: 24px; font-size: 14px; color: var(--notion-text-soft); text-decoration: none; }
.back-link:hover { color: var(--notion-text); }
.newsletter-form { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.newsletter-form input { flex: 1; min-width: 220px; }
.comments { margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--notion-border-soft); }

/* ===== Site landing ===== */
.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.landing-hero {
	padding-bottom: 0;
}
.page-home .landing-hero {
	padding-bottom: 8px;
}
.landing-hero h1 {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: clamp(36px, 6vw, 56px);
	margin-bottom: 0;
}
.page-home .devlog-teaser {
	margin-top: 3.5rem;
}
.devlog-teaser {
	margin-top: 0;
	padding: 24px 28px;
	border-radius: 12px;
	border: 1px solid var(--notion-border);
	background: var(--notion-bg-soft);
}
#newsletter {
	content-visibility: auto;
	contain-intrinsic-size: auto 360px;
}
.devlog-teaser .post-link {
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	box-shadow: none;
}
.devlog-teaser .post-link:hover {
	background: transparent;
	border-color: transparent;
}
.devlog-teaser .notion-button-group {
	margin-top: 20px;
}
.form-embed {
	margin-top: 12px;
	width: 100%;
}
.social-icons {
	display: flex;
	gap: 12px;
	margin-top: 14px;
}
.social-icons a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: var(--notion-radius);
	text-decoration: none;
	transition: background 120ms ease;
}
.social-icons a:hover {
	background: var(--notion-surface-hover);
}
.social-icons img {
	display: block;
	width: 1.5rem;
	height: 1.5rem;
	object-fit: contain;
}
.social-icons a[href*="discord"] img {
	width: 1.75rem;
	height: 1.35rem;
}
@media (prefers-color-scheme: dark) {
	.social-icons img[src$=".png"] {
		filter: invert(1);
	}
}
