/*
 * OMOIYARI Screens — the look of the journey.
 *
 * Base (no JavaScript): every screen is visible, stacked, readable. JavaScript
 * adds .oms-js to <html> and opts into the one-at-a-time fade. Motion is only
 * ever added on top of a page that already reads without it.
 */

:root {
	--oms-serif: Georgia, "Times New Roman", serif;
	--oms-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--oms-body: var(--oms-serif);
	--oms-head: var(--oms-serif);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	background: #000;
	color: #1a1a1a;
	font-family: var(--oms-body);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }

.oms { display: block; }

/* A screen fills the view and centres its words over its background. */
.oms-screen {
	position: relative;
	min-height: 100svh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8vh 22px;
	background: var(--bg, #fff);
	color: var(--ink, #1a1a1a);
	overflow: hidden;
}

.oms-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	z-index: 0;
}
.oms-vid {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.oms-wrap {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 40rem;
	margin: 0 auto;
	text-align: center;
}

.oms-heading {
	font-family: var(--oms-head);
	font-weight: 500;
	font-size: clamp(1.9rem, 6vw, 3.4rem);
	line-height: 1.1;
	letter-spacing: -0.01em;
	margin: 0 0 0.6em;
	text-wrap: balance;
}
.oms-words {
	font-size: clamp(1.05rem, 2.4vw, 1.35rem);
	line-height: 1.6;
	margin: 0 auto;
	max-width: 34rem;
}
.oms-words p { margin: 0 0 0.9em; }
.oms-words p:last-child { margin-bottom: 0; }

/* Where they answer. */
.oms-answer {
	display: block;
	width: 100%;
	max-width: 34rem;
	margin: 1.6em auto 0;
	padding: 0.9em 1em;
	font: inherit;
	font-size: 1.1rem;
	line-height: 1.5;
	color: var(--ink, #1a1a1a);
	background: rgba(255, 255, 255, 0.86);
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 12px;
	resize: vertical;
}
.oms-answer:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* The quiet word that moves them on, and the keep link — never a filled pill. */
.oms-onward,
.oms-made-keep {
	display: inline-block;
	margin-top: 1.8em;
	padding: 0;
	font: inherit;
	font-size: 1.05rem;
	color: inherit;
	background: none;
	border: 0;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
	cursor: pointer;
	text-decoration: none;
	opacity: 0.85;
	transition: opacity 0.25s ease;
}
.oms-onward:hover,
.oms-made-keep:hover { opacity: 1; }
.oms-onward:focus-visible,
.oms-made-keep:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.oms-powered {
	margin: 2.4em 0 0;
	font-family: var(--oms-sans);
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.62;
}
.oms-powered a { color: inherit; }

/* The fork: each choice a quiet card, never a stack of filled pills. */
.oms-choices {
	display: flex;
	flex-direction: column;
	gap: 0.7em;
	max-width: 30rem;
	margin: 1.8em auto 0;
}
.oms-choice {
	font: inherit;
	font-size: 1.1rem;
	color: inherit;
	background: rgba(255, 255, 255, 0.72);
	border: 1px solid currentColor;
	border-radius: 14px;
	padding: 0.85em 1.1em;
	cursor: pointer;
	text-align: left;
	transition: background 0.2s ease, transform 0.2s ease;
}
.oms-choice:hover { background: rgba(255, 255, 255, 0.92); transform: translateY(-1px); }
.oms-choice:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* The help at the end. */
.oms-made-title {
	font-family: var(--oms-head);
	font-size: clamp(1.5rem, 4vw, 2.2rem);
	margin: 0 0 0.6em;
	text-wrap: balance;
}
.oms-made-body {
	font-size: clamp(1.05rem, 2.4vw, 1.3rem);
	line-height: 1.65;
	text-align: left;
}
.oms-made-body p { margin: 0 0 0.9em; }

.oms-thinking { display: flex; gap: 0.5em; justify-content: center; }
.oms-thinking span {
	width: 9px; height: 9px; border-radius: 50%;
	background: currentColor; opacity: 0.35;
	animation: oms-pulse 1.2s ease-in-out infinite;
}
.oms-thinking span:nth-child(2) { animation-delay: 0.2s; }
.oms-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes oms-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }

.oms-page { min-height: 100svh; }
.oms-page .oms-wrap { padding: 10vh 0; }

/* ---- With JavaScript: one screen at a time, faded in. ---- */
.oms-js .oms .oms-screen { opacity: 0; transition: opacity 0.9s ease; }
.oms-js .oms .oms-screen.is-here { opacity: 1; }

/* In "onward" mode only the one they are on takes the view. */
.oms-js .oms[data-advance="onward"] .oms-screen { display: none; }
.oms-js .oms[data-advance="onward"] .oms-screen.is-here { display: flex; }

/* Anyone who has asked their phone to stop motion gets it all, still, at once. */
@media (prefers-reduced-motion: reduce) {
	.oms-js .oms .oms-screen,
	.oms-js .oms[data-advance="onward"] .oms-screen { opacity: 1; display: flex; transition: none; }
	.oms-vid { display: none; }
	.oms-thinking span { animation: none; }
}
