/*
 * Cluasa teaser. Brand roles copied from the app's app.css: Mist or Night Pine ground, Deep Pine
 * ink, the burnt-orange curl for attention only. Fraunces for the word, Instrument Sans for the
 * footer, both self-hosted so the page makes no third-party request.
 *
 * The page is the logo mark grown to fill the screen, with the word spoken out of its open side.
 * The one motion is the mark drawing itself on load; prefers-reduced-motion shows it finished.
 */
@font-face {
	font-family: "Fraunces";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("/fonts/fraunces-600-latin.woff2") format("woff2");
}
@font-face {
	font-family: "Instrument Sans";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("/fonts/instrument-sans-latin.woff2") format("woff2");
}

:root {
	color-scheme: light dark;
	--bg: light-dark(#f4f7f5, #0d1f1c);
	--ink: light-dark(#12332e, #e9f3f0);
	--muted: light-dark(#4a635e, #a9c2bc);
	--curl: light-dark(#c2410c, #ff9466);
	--display: "Fraunces", "Iowan Old Style", Georgia, serif;
	--text: "Instrument Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
	/* Side of the drawn mark. The word is sized from it so the pair scales as one shape. */
	--s: min(44vw, 52svh, 30rem);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 400 1rem/1.5 var(--text); }
body {
	margin: 0;
	min-height: 100svh;
	display: grid;
	grid-template-rows: 1fr auto;
}
:focus-visible { outline: 3px solid var(--curl); outline-offset: 4px; border-radius: 2px; }

.stage { display: grid; place-items: center; padding: 1.5rem; }

.figure {
	position: relative;
	width: calc(var(--s) * 1.96);
	height: var(--s);
}
.curl { position: absolute; inset: 0 auto 0 0; width: var(--s); height: var(--s); overflow: visible; }
.curl path { fill: none; stroke-linecap: round; }
.curl .outer { stroke: var(--curl); stroke-width: 5; }
.curl .inner { stroke: var(--ink); stroke-width: 4; }
.curl .dot { fill: var(--ink); }

/* Starts just past the outer arc's open ends (x 34 of 48), so the word leaves the mark's mouth. */
.word {
	position: absolute;
	left: calc(var(--s) * 0.86);
	top: 50%;
	margin: 0;
	transform: translateY(-50%);
	font: 600 calc(var(--s) * 0.4) / 1 var(--display);
	letter-spacing: -0.03em;
	white-space: nowrap;
}

.foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	padding: 1.25rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
	color: var(--muted);
	font-size: 0.9375rem;
}
.foot a { color: var(--muted); text-underline-offset: 0.2em; }
.foot a:hover { color: var(--ink); text-decoration-thickness: 2px; }
.logo { height: 1.9rem; width: auto; display: block; }
.logo-d { display: none; }
@media (prefers-color-scheme: dark) {
	.logo-l { display: none; }
	.logo-d { display: block; }
}

@media (prefers-reduced-motion: no-preference) {
	.curl path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s cubic-bezier(.6, 0, .2, 1) forwards; }
	.curl .inner { animation-delay: .55s; animation-duration: 1s; }
	.curl .dot { transform-origin: 27px 24px; transform: scale(0); animation: dot .5s cubic-bezier(.3, 1.6, .5, 1) 1.35s forwards; }
	.word { opacity: 0; animation: speak 1.1s ease-out 1.6s forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dot { to { transform: scale(1); } }
@keyframes speak {
	from { opacity: 0; transform: translate(-0.12em, -50%); }
	to { opacity: 1; transform: translate(0, -50%); }
}
