:root {
	--sd-ink: #11182a;
	--sd-paper: #f7f0e3;
	--sd-paper-light: #fffaf1;
	--sd-accent: #ed7138;
	--sd-line: rgba(17, 24, 42, 0.2);
}

.sd-denkraum,
.sd-denkraum * {
	box-sizing: border-box;
}

.sd-denkraum {
	position: relative;
	isolation: isolate;
	width: 100vw;
	max-width: none !important;
	margin-inline: calc(50% - 50vw) !important;
	color: var(--sd-ink);
	background-color: #c9c3b9;
	background-image: var(--sd-background-image);
	background-position: center;
	background-size: cover;
	background-attachment: fixed;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	overflow: clip;
}

.sd-atmosphere {
	position: absolute;
	z-index: -2;
	inset: 0;
	background: linear-gradient(120deg, rgba(241, 232, 218, 0.42), rgba(246, 239, 226, 0.73));
	backdrop-filter: blur(4px) saturate(0.62);
	pointer-events: none;
}

.sd-atmosphere::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle at 78% 18%, rgba(255, 253, 246, 0.78), transparent 32%),
		linear-gradient(to bottom, rgba(249, 243, 232, 0.18), rgba(222, 214, 199, 0.48));
}

.sd-intro-header,
.sd-section {
	position: relative;
	min-height: 100svh;
	padding: clamp(5rem, 10vw, 9rem) clamp(1.4rem, 7vw, 8rem);
}

.sd-intro-header {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	background: linear-gradient(90deg, rgba(247, 240, 227, 0.94) 0%, rgba(247, 240, 227, 0.78) 52%, rgba(247, 240, 227, 0.2) 100%);
}

.sd-intro-header::before {
	content: "";
	display: block;
	width: 3.2rem;
	height: 3.2rem;
	margin-bottom: 1.5rem;
	border-radius: 1rem;
	background: var(--sd-accent);
	box-shadow: 0 1rem 2rem rgba(53, 35, 22, 0.13);
}

.sd-kicker {
	margin: 0 0 1rem;
	font-size: 0.76rem;
	font-weight: 760;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.sd-intro-header h1 {
	max-width: 11ch;
	margin: 0;
	color: var(--sd-ink);
	font-size: clamp(2.8rem, 7vw, 6.5rem);
	font-weight: 850;
	line-height: 0.88;
	letter-spacing: -0.075em;
	text-wrap: balance;
}

.sd-header-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin-top: 2.2rem;
}

.sd-action,
.sd-pdf-button {
	appearance: none;
	border: 1px solid var(--sd-ink);
	border-radius: 999px;
	background: rgba(255, 250, 241, 0.62);
	color: var(--sd-ink);
	cursor: pointer;
	font: inherit;
	font-size: 0.82rem;
	font-weight: 720;
	line-height: 1;
	padding: 0.9rem 1.15rem;
	transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.sd-action:hover,
.sd-action:focus-visible,
.sd-pdf-button:hover,
.sd-pdf-button:focus-visible {
	background: var(--sd-ink);
	color: var(--sd-paper-light);
	transform: translateY(-2px);
}

.sd-scroll-cue {
	position: absolute;
	bottom: 2rem;
	left: clamp(1.4rem, 7vw, 8rem);
	color: inherit;
	font-size: 0.84rem;
	font-weight: 700;
	text-decoration: none;
}

.sd-scroll-cue span {
	display: inline-block;
	margin-left: 0.35rem;
	animation: sd-breathe 2.4s ease-in-out infinite;
}

@keyframes sd-breathe {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(0.35rem); }
}

.sd-section-nav {
	position: fixed;
	z-index: 12;
	top: 50%;
	right: clamp(0.65rem, 2vw, 1.5rem);
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	transform: translateY(-50%);
}

.sd-section-nav a {
	display: block;
	width: 0.62rem;
	height: 0.62rem;
	border: 1px solid var(--sd-ink);
	border-radius: 50%;
	background: rgba(255, 250, 241, 0.7);
	box-shadow: 0 0.3rem 1rem rgba(17, 24, 42, 0.08);
	transition: transform 180ms ease, background 180ms ease;
}

.sd-section-nav a[aria-current="true"] {
	background: var(--sd-accent);
	transform: scale(1.45);
}

.sd-section {
	display: grid;
	place-items: center;
	scroll-margin-top: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.sd-section:nth-child(odd) {
	background: rgba(247, 240, 227, 0.73);
}

.sd-section:nth-child(even) {
	background: rgba(225, 220, 210, 0.67);
}

.sd-section__inner {
	width: min(100%, 112rem);
}

.sd-section__heading {
	display: flex;
	align-items: baseline;
	gap: 1rem;
	margin: 0 auto clamp(1.5rem, 4vw, 3.5rem);
	max-width: 92rem;
}

.sd-section__heading p,
.sd-section__heading h2 {
	margin: 0;
}

.sd-section__heading p {
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.15em;
}

.sd-section__heading h2 {
	color: var(--sd-ink);
	font-size: clamp(1rem, 1.6vw, 1.4rem);
	font-weight: 760;
	letter-spacing: -0.02em;
}

.sd-thought {
	max-width: min(30ch, 92vw);
	margin: 6vh auto;
	font-family: "Bradley Hand", Noteworthy, "Segoe Print", "Comic Sans MS", cursive;
	font-size: clamp(1.75rem, 4.2vw, 4.2rem);
	font-weight: 400;
	line-height: 1.18;
	letter-spacing: 0.006em;
	text-align: center;
	text-wrap: balance;
	transform: rotate(-0.8deg);
	overflow-wrap: anywhere;
}

.sd-thought--long {
	max-width: min(46rem, 92vw);
	font-size: clamp(1.4rem, 2.6vw, 2.5rem);
	line-height: 1.36;
	text-align: left;
	text-wrap: pretty;
	transform: none;
}

.sd-book-page {
	position: relative;
	width: min(100%, 49rem);
	min-height: min(74vh, 58rem);
	margin: 0 auto;
	padding: clamp(3rem, 8vw, 7rem) clamp(2rem, 7vw, 6.5rem);
	background:
		linear-gradient(90deg, rgba(29, 23, 17, 0.08), transparent 5%),
		var(--sd-paper-light);
	box-shadow: 0 2.5rem 7rem rgba(41, 34, 26, 0.18), -0.5rem 0 1.7rem rgba(54, 43, 32, 0.09);
	color: #24201c;
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(1.05rem, 1.35vw, 1.25rem);
	line-height: 1.72;
}

.sd-book-page::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 1px;
	background: rgba(35, 28, 21, 0.14);
}

.sd-book-page > :first-child { margin-top: 0; }
.sd-book-page > :last-child { margin-bottom: 0; }
.sd-book-page h2,
.sd-book-page h3 {
	font-family: Inter, ui-sans-serif, system-ui, sans-serif;
	letter-spacing: -0.035em;
}

.sd-media-gallery,
.sd-video-list {
	display: flex;
	gap: clamp(1rem, 3vw, 2.5rem);
	width: 100%;
	overflow-x: auto;
	padding: 1rem max(0px, calc((100% - 92rem) / 2)) 2.4rem;
	scroll-snap-type: x mandatory;
	scrollbar-color: var(--sd-ink) transparent;
}

.sd-media-item,
.sd-video-item {
	flex: 0 0 min(88vw, 92rem);
	margin: 0;
	scroll-snap-align: center;
}

.sd-image-button {
	display: grid;
	width: 100%;
	height: min(67vh, 56rem);
	place-items: center;
	padding: 0;
	border: 0;
	background: rgba(250, 247, 240, 0.28);
	cursor: zoom-in;
}

.sd-image-button img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 1.5rem 2.5rem rgba(35, 29, 23, 0.18));
}

.sd-media-item figcaption,
.sd-video-item figcaption {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 0.8rem;
	font-size: 0.82rem;
}

.sd-media-item figcaption a,
.sd-video-item figcaption a,
.sd-audio-item > a {
	color: inherit;
	font-weight: 700;
	text-underline-offset: 0.2em;
}

.sd-video-item video {
	display: block;
	width: 100%;
	max-height: 68vh;
	background: #0b0d12;
	box-shadow: 0 1.8rem 4rem rgba(15, 18, 26, 0.18);
}

.sd-audio-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
	gap: 1rem;
	width: min(100%, 64rem);
	margin: 6vh auto;
}

.sd-audio-item,
.sd-companion-text {
	padding: clamp(1.4rem, 4vw, 2.6rem);
	border: 1px solid rgba(17, 24, 42, 0.14);
	border-radius: 1.5rem;
	background: rgba(255, 250, 241, 0.72);
	backdrop-filter: blur(14px);
}

.sd-audio-item p,
.sd-companion-text h3 {
	margin-top: 0;
	font-weight: 760;
}

.sd-audio-item audio {
	display: block;
	width: 100%;
	margin: 1.2rem 0;
}

.sd-companion-text {
	width: min(100%, 64rem);
	margin: 2rem auto 0;
	grid-column: 1 / -1;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.08rem;
	line-height: 1.7;
}

.sd-companion-text > :last-child {
	margin-bottom: 0;
}

.sd-script-page {
	width: min(100%, 58rem);
	margin: 0 auto;
	padding: clamp(2rem, 6vw, 5rem);
	border-left: 0.35rem solid var(--sd-accent);
	background: rgba(255, 250, 241, 0.82);
	box-shadow: 0 2rem 6rem rgba(41, 34, 26, 0.14);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: clamp(0.98rem, 1.25vw, 1.12rem);
	line-height: 1.75;
}

.sd-script-page p {
	margin: 0;
}

.sd-pdf-button {
	display: block;
	margin: 2rem auto 0;
	background: transparent;
}

.sd-lightbox {
	width: 100vw;
	max-width: none;
	height: 100vh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(14, 18, 28, 0.96);
	color: #fff;
}

.sd-lightbox::backdrop { background: rgba(14, 18, 28, 0.9); }

.sd-lightbox__bar {
	position: absolute;
	z-index: 2;
	top: 1rem;
	right: 1rem;
	display: flex;
	gap: 0.45rem;
}

.sd-lightbox__bar button {
	min-width: 2.6rem;
	min-height: 2.6rem;
	border: 1px solid rgba(255,255,255,0.45);
	border-radius: 999px;
	background: rgba(255,255,255,0.12);
	color: #fff;
	cursor: pointer;
	font: inherit;
}

.sd-lightbox__bar button:last-child { padding-inline: 1rem; }

.sd-lightbox__stage {
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
	overflow: auto;
	padding: 5rem 2rem 2rem;
}

.sd-lightbox__stage img {
	display: block;
	max-width: 90vw;
	max-height: 84vh;
	object-fit: contain;
	transform: scale(var(--sd-image-scale, 1));
	transform-origin: center;
	transition: transform 120ms ease;
}

.sd-empty {
	padding: 3rem;
	border: 1px dashed currentColor;
}

@media (max-width: 680px) {
	.sd-intro-header,
	.sd-section { padding-inline: 1.25rem; }
	.sd-intro-header h1 { font-size: clamp(2.8rem, 14vw, 5rem); }
	.sd-section-nav { right: 0.45rem; }
	.sd-section__heading { padding-right: 1rem; }
	.sd-thought { font-size: clamp(1.7rem, 7.8vw, 3rem); }
	.sd-thought--long { font-size: clamp(1.3rem, 5.8vw, 2rem); }
	.sd-book-page { min-height: 72vh; padding: 3rem 1.65rem; }
	.sd-media-item,
	.sd-video-item { flex-basis: 92vw; }
	.sd-image-button { height: 65vh; }
	.sd-header-actions { padding-right: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
	.sd-scroll-cue span { animation: none; }
	.sd-denkraum { scroll-behavior: auto; }
	.sd-action,
	.sd-pdf-button,
	.sd-section-nav a,
	.sd-lightbox__stage img { transition: none; }
}

@media print {
	@page { margin: 16mm; }

	body.sd-denkraum-printing > * { visibility: hidden !important; }
	body.sd-denkraum-printing .sd-denkraum,
	body.sd-denkraum-printing .sd-denkraum * { visibility: visible !important; }

	body.sd-denkraum-printing .sd-denkraum {
		position: absolute;
		top: 0;
		left: 0;
		width: 100% !important;
		margin: 0 !important;
		background: #fff !important;
		color: #111 !important;
	}

	.sd-denkraum .sd-atmosphere,
	.sd-denkraum .sd-section-nav,
	.sd-denkraum .sd-header-actions,
	.sd-denkraum .sd-scroll-cue,
	.sd-denkraum .sd-pdf-button,
	.sd-denkraum .sd-lightbox { display: none !important; }

	.sd-denkraum.sd-print-single .sd-intro-header,
	.sd-denkraum.sd-print-single .sd-section:not(.sd-print-target) { display: none !important; }

	.sd-denkraum .sd-intro-header,
	.sd-denkraum .sd-section {
		min-height: 0;
		padding: 10mm 0;
		break-after: page;
		background: #fff !important;
	}

	.sd-denkraum .sd-intro-header h1 { font-size: 52pt; }
	.sd-denkraum .sd-section__heading { margin-bottom: 7mm; }
	.sd-denkraum .sd-thought { font-size: 25pt; }
	.sd-denkraum .sd-thought--long { font-size: 15pt; }
	.sd-denkraum .sd-book-page { min-height: 0; box-shadow: none; }
	.sd-denkraum .sd-media-gallery,
	.sd-denkraum .sd-video-list { display: block; overflow: visible; padding: 0; }
	.sd-denkraum .sd-media-item,
	.sd-denkraum .sd-video-item { break-inside: avoid; margin-bottom: 10mm; }
	.sd-denkraum .sd-image-button { height: auto; max-height: 225mm; }
	.sd-denkraum .sd-image-button img { max-height: 220mm; }
}
