/*
 * Smoochinton link page. Night at the Gate: indigo sky, lilac stone, and one
 * warm accent, the lantern. Rose is kept for errors and nothing else.
 *
 * Everything is served by the plugin itself (fonts and favicon included), so the
 * Content-Security-Policy in WebServer can stay at 'self' with no third parties.
 * No inline styles anywhere: the CSP doesn't allow them.
 *
 * IM Fell English: headings and the Registry entry (an old printed-book face,
 * for a book with no last page). Atkinson Hyperlegible: everything else, and
 * the code field in particular, since it was drawn so similar letters can't be
 * mistaken for each other.
 */

@font-face {
	font-family: "Fell";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url(/assets/fonts/fell-400.woff2) format("woff2");
}

@font-face {
	font-family: "Fell";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url(/assets/fonts/fell-400-italic.woff2) format("woff2");
}

@font-face {
	font-family: "Atkinson";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url(/assets/fonts/atkinson-400.woff2) format("woff2");
}

@font-face {
	font-family: "Atkinson";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url(/assets/fonts/atkinson-700.woff2) format("woff2");
}

:root {
	--night: #1b1a33;
	--dusk: #29274d;
	--stone: #9a94b8;
	--parchment: #f2e8d2;
	--lantern: #ffb84d;
	--rose: #ff8fa3;

	--ink: #2a2335;
	--muted: #b9b3d1;

	--serif: "Fell", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--sans: "Atkinson", "Segoe UI", system-ui, sans-serif;

	color-scheme: dark;
}

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

html {
	background: var(--night);
	color: var(--parchment);
	font: 400 1.0625rem/1.6 var(--sans);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	/* The sky lightens a little toward the horizon the Gate stands on. */
	background: linear-gradient(180deg, var(--night) 0%, var(--night) 35%, #24224a 100%);
}

.column {
	width: 100%;
	max-width: 30rem;
	margin: 0 auto;
	padding: 0 1.5rem;
}

main.column {
	flex: 1;
	padding-top: clamp(1.5rem, 6vh, 4rem);
	padding-bottom: 3rem;
}

a {
	color: var(--lantern);
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--parchment);
}

:focus-visible {
	outline: 2px solid var(--parchment);
	outline-offset: 3px;
	border-radius: 2px;
}

/* ── The Gate ─────────────────────────────────────────────────────── */

.gate {
	margin: 0 auto 1.75rem;
	max-width: 25rem;
}

.gate-art {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.gate-art .door {
	transform-box: fill-box;
}

.gate-art .door-left {
	transform-origin: left center;
}

.gate-art .door-right {
	transform-origin: right center;
}

.gate-art .spill {
	opacity: 0;
}

.gate-art .glow {
	transform-box: fill-box;
	transform-origin: center;
	animation: flicker 5s ease-in-out infinite;
}

@keyframes flicker {
	0%, 100% { opacity: 1; }
	40% { opacity: 0.86; }
	55% { opacity: 0.95; }
	70% { opacity: 0.82; }
}

/* Linked: the doors swing back once and the light from the land beyond spills
   out onto the ground. The only motion on the page besides the lantern. */
.gate--open .door {
	animation: swing 1.4s cubic-bezier(0.55, 0, 0.2, 1) 0.35s both;
}

.gate--open .spill {
	animation: spill 1.2s ease-out 0.9s both;
}

@keyframes swing {
	to { transform: scaleX(0.14); }
}

@keyframes spill {
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.gate-art .glow {
		animation: none;
	}

	.gate--open .door {
		animation: none;
		transform: scaleX(0.14);
	}

	.gate--open .spill {
		animation: none;
		opacity: 1;
	}
}

/* ── Text ─────────────────────────────────────────────────────────── */

h1 {
	font: 400 clamp(2rem, 7vw, 2.6rem) / 1.1 var(--serif);
	letter-spacing: 0.005em;
	margin-bottom: 0.75rem;
	text-wrap: balance;
}

.lede {
	color: var(--muted);
	margin-bottom: 2rem;
}

.small {
	font-size: 0.9375rem;
	color: var(--muted);
	margin-top: 1.75rem;
}

code {
	font: inherit;
	font-weight: 700;
	color: var(--parchment);
}

.notice {
	border-left: 3px solid var(--rose);
	padding: 0.15rem 0 0.15rem 0.9rem;
	margin-bottom: 1.75rem;
	color: var(--parchment);
}

/* ── The code form ────────────────────────────────────────────────── */

label {
	display: block;
	font-weight: 700;
	margin-bottom: 0.5rem;
}

input[type="text"] {
	display: block;
	width: 100%;
	font: 700 1.75rem/1 var(--sans);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--parchment);
	background: var(--dusk);
	/* Set into the stone: darker on top, as if cut into it. */
	border: 1px solid #4a4680;
	border-top-color: #12112a;
	border-radius: 6px;
	box-shadow: inset 0 2px 6px rgba(9, 8, 24, 0.55);
	padding: 0.85rem 1rem 0.8rem;
}

input[type="text"]::placeholder {
	color: #6c6794;
	letter-spacing: 0.16em;
}

input[type="text"]:focus {
	outline: none;
	border-color: var(--lantern);
	box-shadow: inset 0 2px 6px rgba(9, 8, 24, 0.55), 0 0 0 3px rgba(255, 184, 77, 0.28);
}

.hint {
	font-size: 0.9375rem;
	color: var(--muted);
	margin-top: 0.6rem;
}

button {
	display: inline-block;
	margin-top: 1.5rem;
	font: 700 1.0625rem/1 var(--sans);
	color: var(--night);
	background: var(--lantern);
	border: 0;
	border-radius: 6px;
	padding: 0.95rem 1.4rem;
	cursor: pointer;
	box-shadow: 0 0 24px rgba(255, 184, 77, 0.25);
}

button:hover {
	background: #ffc870;
}

button:active {
	transform: translateY(1px);
}

/* Error pages: the hint sits directly above the way back. */
.notice + .lede {
	margin-bottom: 0.5rem;
}

button.quiet {
	color: var(--parchment);
	background: transparent;
	border: 1px solid var(--stone);
	box-shadow: none;
}

button.quiet:hover {
	background: var(--dusk);
}

/* ── The Registry entry (success) ─────────────────────────────────── */

.registry {
	color: var(--ink);
	background: var(--parchment);
	border-radius: 3px;
	padding: 1.1rem 1.4rem 0.6rem;
	box-shadow: 0 18px 40px -18px rgba(255, 184, 77, 0.35);
	margin-bottom: 0.5rem;
}

.registry-no {
	font: 400 3.25rem/1 var(--serif);
	padding-bottom: 0.5rem;
}

/* Ruled like a ledger page: one line under the number and each entry. */
.registry-no,
.registry dl div {
	border-bottom: 1px solid rgba(42, 35, 53, 0.16);
}

.registry dl div:last-child {
	border-bottom: 0;
}

.registry dl div {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	line-height: 2.4rem;
}

.registry dt {
	font-size: 0.9375rem;
	color: #5c5270;
}

.registry dd {
	font: italic 400 1.3rem/2.4rem var(--serif);
	text-align: right;
	overflow-wrap: anywhere;
}

/* Fell only has old-style figures, which make a seven-digit number bounce. */
.registry dd.license {
	font: 700 1rem/2.4rem var(--sans);
	letter-spacing: 0.04em;
	font-variant-numeric: lining-nums tabular-nums;
}

/* ── Footer ───────────────────────────────────────────────────────── */

footer.column {
	padding-bottom: 2rem;
	font-size: 0.9375rem;
	color: var(--muted);
}

footer p + p {
	margin-top: 0.25rem;
}
