/* mindfulness-anna.fabric-sync.com — deck chrome.
   One palette, sampled from the deck itself, so the overlay layer and the UI
   read as one piece across three very differently-styled Canva templates. */

:root {
	--gold: #c59e67;      /* slide 1 title gold — the through-line of the deck */
	--gold-lt: #e4c79a;
	--gold-dim: rgba(197, 158, 103, .38);
	--ink: #0d0e12;       /* slide 1 ground */
	--cream: #f9efe6;     /* slide 2 ground */
	--violet: #5d17eb;    /* slide 3 accent */
	--stage: #07070a;
	--ui: 200ms cubic-bezier(.22, .61, .36, 1);
	--breath: 11s;        /* one full inhale+exhale — the deck's tempo */
}

/* The cream page needs the opposite chrome: the same ink the slide itself
   uses for type, or the controls vanish into the paper. */
body[data-tone="light"] {
	--gold: #8a6a3f;
	--gold-lt: #4a3320;
	--gold-dim: rgba(90, 62, 36, .30);
}

* { box-sizing: border-box; }

html, body {
	height: 100%;
	margin: 0;
	background: var(--stage);
	color: var(--gold-lt);
	font: 400 14px/1.4 ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
	overflow: hidden;
	overscroll-behavior: none;
	-webkit-font-smoothing: antialiased;
}

/* ── stage ────────────────────────────────────────────────────────────── */

#stage {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	touch-action: manipulation;
}

/* The deck pages are 8:5 — the plate keeps that ratio at any viewport. */
.plate {
	position: relative;
	width: min(100vw, calc(100dvh * 1.6));
	aspect-ratio: 8 / 5;
	background: #000;
	overflow: hidden;
	box-shadow: 0 0 0 1px rgba(197, 158, 103, .10), 0 40px 120px -40px rgba(0, 0, 0, .9);
}

.slides, .slides img, #fx, .vignette {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.slides img {
	object-fit: cover;
	opacity: 0;
	transform: scale(1.012);
	transition: opacity 700ms cubic-bezier(.4, 0, .2, 1), transform 1400ms cubic-bezier(.22, .61, .36, 1);
	will-change: opacity, transform;
}

.slides img.on { opacity: 1; transform: scale(1); }

#fx { pointer-events: none; }

/* A single soft vignette over every page — the cheapest way to make three
   unrelated templates feel like one deck. */
.vignette {
	pointer-events: none;
	background:
		radial-gradient(120% 100% at 50% 45%, transparent 52%, rgba(0, 0, 0, .30) 100%);
	mix-blend-mode: multiply;
}

/* click/tap zones — invisible, keyboard reachable */
.edge {
	position: fixed;
	top: 0;
	bottom: 0;
	width: 22vw;
	max-width: 260px;
	cursor: pointer;
	outline: none;
}
.edge-l { left: 0; }
.edge-r { right: 0; }
.edge:focus-visible { box-shadow: inset 0 0 0 2px var(--gold-dim); }

/* ── chrome ───────────────────────────────────────────────────────────── */

.chrome {
	position: fixed;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 18px 24px;
	z-index: 5;
	opacity: 1;
	transition: opacity 420ms ease;
}
.chrome-top { top: 0; }
.chrome-bottom { bottom: 0; justify-content: center; }

body.idle .chrome { opacity: 0; }
body.idle #stage { cursor: none; }

.mark {
	display: inline-flex;
	opacity: .5;
	transition: opacity var(--ui);
}
.mark:hover { opacity: 1; }
.mark img { filter: invert(1); display: block; }
body[data-tone="light"] .mark img { filter: none; }
body[data-tone="light"] .mark { opacity: .38; }

.chapter {
	font-size: 10px;
	letter-spacing: .34em;
	text-transform: uppercase;
	color: var(--gold);
	opacity: .7;
}

.rail {
	display: flex;
	align-items: center;
	gap: 8px;
}
.rail button {
	appearance: none;
	border: 0;
	padding: 10px 0;
	background: none;
	cursor: pointer;
	width: 46px;
}
.rail i {
	display: block;
	height: 1px;
	background: var(--gold-dim);
	transition: background var(--ui), transform var(--ui);
	transform-origin: left;
}
.rail button[aria-current="true"] i { background: var(--gold-lt); transform: scaleY(2); }
.rail button:hover i { background: var(--gold); }

.counter {
	font-variant-numeric: tabular-nums;
	font-size: 11px;
	letter-spacing: .18em;
	color: var(--gold);
	opacity: .75;
	margin-left: 6px;
}
.counter b { font-weight: 500; color: var(--gold-lt); }
.counter i { opacity: .4; margin: 0 4px; font-style: normal; }

.tools { display: flex; gap: 4px; margin-left: 10px; }

.tool {
	position: relative;
	appearance: none;
	border: 0;
	background: none;
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	cursor: pointer;
	color: var(--gold);
	opacity: .55;
	transition: opacity var(--ui);
}
.tool:hover, .tool:focus-visible { opacity: 1; outline: none; }
.tool svg {
	width: 19px;
	height: 19px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.tool .spk { fill: currentColor; stroke-width: 1; }
.tool .cross { opacity: 1; }
.tool .waves { opacity: 0; }
.tool[aria-pressed="true"] .cross { opacity: 0; }
.tool[aria-pressed="true"] .waves { opacity: 1; }
.tool[aria-pressed="true"] { opacity: 1; }
.tool .tip {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	font-size: 9px;
	letter-spacing: .2em;
	text-transform: uppercase;
	opacity: 0;
	pointer-events: none;
	white-space: nowrap;
	transition: opacity var(--ui);
}
.tool:hover .tip { opacity: .7; }

/* ── boot ─────────────────────────────────────────────────────────────── */

#boot {
	position: fixed;
	inset: 0;
	z-index: 20;
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 22px;
	background: var(--stage);
	transition: opacity 700ms ease;
}
#boot.gone { opacity: 0; pointer-events: none; }
#boot p {
	margin: 0;
	font-size: 10px;
	letter-spacing: .34em;
	text-transform: uppercase;
	color: var(--gold);
	opacity: .55;
}
#boot .ring {
	width: 54px;
	height: 54px;
	border: 1px solid var(--gold-dim);
	border-radius: 50%;
	animation: breathe var(--breath) ease-in-out infinite;
}
@keyframes breathe {
	0%, 100% { transform: scale(.82); border-color: rgba(197, 158, 103, .22); }
	50%      { transform: scale(1.06); border-color: rgba(228, 199, 154, .75); }
}

@media (prefers-reduced-motion: reduce) {
	.slides img { transition-duration: 1ms; transform: none !important; }
	#boot .ring { animation: none; }
}

@media (max-width: 620px) {
	.chrome { padding: 12px 14px; }
	.rail button { width: 30px; }
	.chapter { display: none; }
}
