:root {
	--on-tertiary-fixed-variant: #6900b3;
	--surface-container-low: #1c1b1d;
	--primary-fixed: #f2daff;
	--primary: #e0b6ff;
	--surface-container: #201f22;
	--on-tertiary: #490080;
	--on-secondary-container: #d8aeff;
	--surface: #131315;
	--on-primary-container: #ca8efc;
	--secondary-fixed: #f0dbff;
	--surface-variant: #353437;
	--tertiary-container: #5b009d;
	--surface-dim: #131315;
	--surface-tint: #e0b6ff;
	--tertiary-fixed: #f0dbff;
	--on-error-container: #ffdad6;
	--on-background: #e5e1e4;
	--surface-container-highest: #353437;
	--inverse-surface: #e5e1e4;
	--surface-container-high: #2a2a2c;
	--on-primary-fixed: #2d004f;
	--background: #131315;
	--secondary-container: #7105c2;
	--on-primary: #4a067a;
	--on-secondary-fixed: #2c0051;
	--secondary: #ddb8ff;
	--outline: #988d9c;
	--on-primary-fixed-variant: #632892;
	--primary-fixed-dim: #e0b6ff;
	--surface-bright: #39393b;
	--tertiary-fixed-dim: #ddb7ff;
	--outline-variant: #4c4451;
	--on-secondary-fixed-variant: #6800b4;
	--inverse-on-surface: #313032;
	--tertiary: #ddb7ff;
	--error: #ffb4ab;
	--error-container: #93000a;
	--on-tertiary-fixed: #2c0051;
	--on-surface: #e5e1e4;
	--on-surface-variant: #cfc2d2;
	--secondary-fixed-dim: #ddb8ff;
	--on-secondary: #490080;
	--on-error: #690005;
	--surface-container-lowest: #0e0e10;
	--primary-container: #581c87;
	--inverse-primary: #7c43ab;
	--on-tertiary-container: #c88fff;
	--space-xs: 0.25rem;
	--space-sm: 0.5rem;
	--space-md: 1rem;
	--space-lg: 1.5rem;
	--space-xl: 2.5rem;
	--margin: 2rem;
	--gutter: 1.5rem;
	--font-display: "Segoe UI", system-ui, sans-serif;
	--font-body: "Segoe UI", system-ui, sans-serif;
}

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

html,
body {
	margin: 0;
	padding: 0;
}

body {
	overscroll-behavior: none;
	background: var(--surface);
	color: var(--on-surface);
	font-family: var(--font-body);
	font-size: 15px;
	line-height: 24px;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

::selection {
	background: var(--primary-container);
	color: var(--on-primary-container);
}

::-webkit-scrollbar {
	display: none;
}

main > :first-child {
	margin-top: 0 !important;
}

main > :last-child {
	margin-bottom: 0 !important;
}

a {
	color: inherit;
	text-decoration: none;
}

button,
input,
select {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
	border: 0;
	background: none;
}

.icon {
	width: 22px;
	height: 22px;
	display: block;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}

.icon-sm {
	width: 18px;
	height: 18px;
}

.icon-md {
	width: 20px;
	height: 20px;
}

.cut-mark {
	width: 20px;
	height: 20px;
	display: block;
	flex-shrink: 0;
}

.page {
	width: 100%;
	padding-top: 4rem;
	background: var(--surface);
	flex: 1;
}

.wrap {
	display: flex;
	flex-direction: column;
	width: 100%;
	color: var(--on-surface);
}

.hero {
	position: relative;
	width: 100%;
	max-width: 80rem;
	margin: 0 auto;
	padding: 2.5rem 1.5rem;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.title {
	font-family: var(--font-display);
	font-size: 28px;
	line-height: 36px;
	letter-spacing: -0.02em;
	font-weight: 600;
	text-align: center;
	color: var(--on-surface);
	max-width: 56rem;
	margin: 0;
}

.lead {
	font-size: 15px;
	line-height: 24px;
	color: var(--on-surface-variant);
	text-align: center;
	max-width: 42rem;
	margin: 1rem 0 2.5rem;
}

.rules-page .hero {
	align-items: stretch;
}

.rules-page .title,
.rules-page .lead {
	text-align: left;
	max-width: none;
}

.rules-page .lead {
	margin-bottom: 1.5rem;
}

.back-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
	color: var(--primary);
	font-size: 13px;
	line-height: 20px;
	font-weight: 600;
	transition: color 0.15s ease;
}

.back-link:hover {
	color: var(--on-surface);
}

.rules {
	width: 100%;
	max-width: 56rem;
	background: var(--surface-container);
	padding: 1.5rem;
	box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5);
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.rules h2 {
	margin: 0 0 0.75rem;
	font-family: var(--font-display);
	font-size: 18px;
	line-height: 26px;
	letter-spacing: -0.01em;
	font-weight: 600;
	color: var(--on-surface);
}

.rules p,
.rules li {
	margin: 0 0 0.75rem;
	font-size: 15px;
	line-height: 24px;
	color: var(--on-surface-variant);
}

.rules p:last-child,
.rules li:last-child {
	margin-bottom: 0;
}

.rules ul {
	margin: 0 0 0.25rem;
	padding-left: 1.25rem;
}

.rules a {
	color: var(--primary);
	transition: color 0.15s ease;
}

.rules a:hover {
	color: var(--on-surface);
}

.console {
	width: 100%;
	max-width: 56rem;
	background: var(--surface-container);
	padding: 1.5rem;
	box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.5);
	position: relative;
}

.form {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.75rem;
}

.field {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	background: var(--surface-container-lowest);
	transition: background-color 0.15s ease;
}

.field:focus-within {
	background: var(--surface-container-low);
}

.field .icon {
	margin-left: 1rem;
	color: var(--outline);
	user-select: none;
}

.url-input {
	width: 100%;
	background: transparent;
	border: 0;
	padding: 1rem 0.75rem;
	color: var(--on-surface);
	font-size: 15px;
	line-height: 24px;
	outline: none;
}

.url-input::placeholder {
	color: var(--outline);
}

.clear {
	padding: 0.5rem;
	margin-right: 0.5rem;
	color: var(--outline);
	transition: color 0.15s ease;
}

.clear:hover {
	color: var(--on-surface);
}

.submit {
	padding: 1rem 2rem;
	background: var(--primary-container);
	color: var(--on-surface);
	font-family: var(--font-display);
	font-size: 18px;
	line-height: 26px;
	letter-spacing: -0.01em;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3);
	flex-shrink: 0;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

.submit:hover {
	background: var(--secondary-container);
}

.submit:active {
	transform: scale(0.99);
}

.error-message {
	margin-top: 1rem;
	color: var(--error);
	font-size: 13px;
	line-height: 20px;
	text-align: center;
}

.error-message[hidden],
.result[hidden] {
	display: none;
}

.result {
	margin-top: 1.5rem;
	padding: 1rem;
	background: color-mix(in srgb, var(--primary-container) 20%, transparent);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.badge {
	width: 2.5rem;
	height: 2.5rem;
	background: var(--primary-container);
	color: var(--on-surface);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.result-meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.result-label {
	font-size: 11px;
	line-height: 16px;
	letter-spacing: 0.06em;
	font-weight: 600;
	color: var(--primary);
	text-transform: uppercase;
}

.result-link {
	font-family: var(--font-display);
	font-size: 18px;
	line-height: 26px;
	letter-spacing: -0.01em;
	font-weight: 600;
	color: var(--on-surface);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: color 0.15s ease;
}

.result-link:hover {
	color: var(--primary);
}

.result-side,
.result-main {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
}

.result-side {
	justify-content: flex-end;
	flex-shrink: 0;
	gap: 0.5rem;
}

.copy,
.qr-btn,
.format {
	transition: background-color 0.15s ease;
}

.copy {
	padding: 0.5rem 1rem;
	background: var(--primary-container);
	color: var(--on-surface);
	font-size: 13px;
	line-height: 18px;
	letter-spacing: 0.02em;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 0.375rem;
}

.copy:hover,
.submit:hover {
	background: var(--secondary-container);
}

.qr-btn {
	padding: 0.5rem;
	background: var(--surface-container-high);
	color: var(--on-surface);
}

.qr-mark {
	width: 20px;
	height: 20px;
	display: block;
}

.qr-btn:hover,
.format:hover {
	background: var(--surface-variant);
}

.qr {
	margin-top: 1rem;
	padding: 1rem;
	background: var(--surface-container-lowest);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
}

.qr[hidden] {
	display: none;
}

.qr-frame {
	padding: 0.75rem;
	background: var(--surface-container-highest);
	flex-shrink: 0;
	line-height: 0;
}

.qr-frame img {
	width: 7rem;
	height: 7rem;
	display: block;
}

.qr-copy {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.qr-title {
	font-family: var(--font-display);
	font-size: 18px;
	line-height: 26px;
	letter-spacing: -0.01em;
	font-weight: 600;
	color: var(--on-surface);
}

.qr-text {
	margin: 0;
	font-size: 13px;
	line-height: 20px;
	color: var(--on-surface-variant);
}

.formats {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.25rem;
}

.format {
	padding: 0.375rem 0.75rem;
	background: var(--surface-container-high);
	color: var(--on-surface);
	font-size: 11px;
	line-height: 16px;
	letter-spacing: 0.06em;
	font-weight: 600;
	text-transform: uppercase;
}

.site-footer {
	width: 100%;
	background: var(--surface-container-low);
	padding: 0.75rem 0;
	margin-top: auto;
}

.footer-inner {
	max-width: 80rem;
	margin: 0 auto;
	padding: 0 1.5rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.brand {
	font-family: var(--font-display);
	font-size: 18px;
	line-height: 26px;
	letter-spacing: -0.01em;
	font-weight: 700;
	color: var(--on-surface);
}

.footer-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--space-lg);
}

.footer-nav a {
	font-size: 13px;
	line-height: 20px;
	color: var(--on-surface-variant);
	transition: color 0.15s ease;
}

.footer-nav a:hover,
.footer-nav a.is-active,
.footer-nav button:hover {
	color: var(--on-surface);
}

.footer-nav button {
	padding: 0;
	font-size: 13px;
	line-height: 20px;
	color: var(--on-surface-variant);
	transition: color 0.15s ease;
}

.drawer {
	position: fixed;
	inset: 0;
	z-index: 200;
	pointer-events: none;
}

.drawer.is-open {
	pointer-events: auto;
}

.drawer-backdrop {
	position: absolute;
	inset: 0;
	background: rgb(14 14 16 / 0.62);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.drawer.is-open .drawer-backdrop {
	opacity: 1;
}

.drawer-panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: min(32rem, 100%);
	background: var(--surface-container);
	box-shadow: -16px 0 40px rgb(0 0 0 / 0.45);
	display: flex;
	transform: translateX(100%);
	transition: transform 0.28s ease;
}

.drawer.is-open .drawer-panel {
	transform: translateX(0);
}

.drawer-close {
	position: absolute;
	top: 1rem;
	left: -3.25rem;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 999px;
	background: var(--primary-container);
	color: var(--on-surface);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease;
}

.drawer-close:hover {
	background: var(--secondary-container);
}

.drawer-close .icon {
	transform: rotate(-90deg);
}

.drawer-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	overflow: auto;
}

.drawer-head {
	padding: 1.25rem 1.5rem 0.75rem;
}

.drawer-title {
	margin: 0;
	font-family: var(--font-display);
	font-size: 24px;
	line-height: 32px;
	letter-spacing: -0.02em;
	font-weight: 600;
	color: var(--on-surface);
}

.drawer-content {
	padding: 0.5rem 1.5rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.drawer-text {
	margin: 0;
	color: var(--on-surface-variant);
	font-size: 15px;
	line-height: 24px;
}

.drawer-text code,
.code .tok-str {
	color: var(--primary);
}

.drawer-text code {
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 0.92em;
	background: var(--surface-container-lowest);
	padding: 0.1em 0.35em;
}

.example-title {
	margin: 0 0 0.5rem;
	font-family: var(--font-display);
	font-size: 18px;
	line-height: 26px;
	font-weight: 600;
}

.code {
	background: var(--surface-container-lowest);
	padding: 0.85rem 1rem;
	overflow: auto;
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 13px;
	line-height: 22px;
	color: var(--on-surface);
}

.code-line {
	display: flex;
	gap: 0.75rem;
	white-space: pre;
}

.code-prompt {
	color: var(--outline);
	flex-shrink: 0;
}

.tok-key { color: var(--tertiary); }
.tok-name { color: var(--on-secondary-container); }

@media (max-width: 639px) {
	.drawer-close {
		left: auto;
		right: 0.75rem;
		top: 0.75rem;
	}

	.drawer-head {
		padding-right: 4rem;
	}
}

@media (min-width: 640px) {
	.form {
		flex-direction: row;
	}

	.qr {
		flex-direction: row;
	}
}

@media (min-width: 768px) {
	.hero {
		padding: 4rem 1.5rem;
	}

	.title {
		font-size: 56px;
		line-height: 64px;
		letter-spacing: -0.04em;
		font-weight: 700;
	}

	.lead {
		font-size: 18px;
		line-height: 28px;
	}

	.console,
	.rules {
		padding: 2rem;
	}

	.rules-page .title {
		font-size: 40px;
		line-height: 48px;
	}

	.result {
		flex-direction: row;
	}

	.result-main,
	.result-side {
		width: auto;
	}

	.footer-inner {
		flex-direction: row;
		padding: 0 3rem;
	}
}

@media (min-width: 1024px) {
	.hero {
		padding-left: 3rem;
		padding-right: 3rem;
	}
}
