/*
Theme Name: Stonecut
Text Domain: stonecut
Description: Dark, restrained companion-site theme for Dying to Make You Laugh. No nav, footer only.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
WPVibe: yes
*/

/* ------------------------------------------------------------------
   Tokens: weathered granite, candlelight, one muted amber.
------------------------------------------------------------------- */
:root {
	--bg: #12100d;
	--bg-2: #1a1713;
	--ink: #ebe4d4;
	--ink-dim: #b3aa97;
	--line: #38322a;
	--amber: #c4903a;
	--amber-hi: #d8a24b;
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--gutter: clamp(20px, 6vw, 40px);
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background-color: var(--bg);
	/* A candle glow at the top, a little moss at the bottom corner. */
	background-image:
		radial-gradient(ellipse 90% 45% at 50% -8%, rgba(196, 144, 58, 0.16), transparent 70%),
		radial-gradient(ellipse 70% 40% at 100% 100%, rgba(72, 86, 52, 0.16), transparent 70%);
	background-repeat: no-repeat;
	color: var(--ink);
	font: 400 1.0625rem/1.65 var(--sans);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Fine granite grain over everything. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	opacity: 0.07;
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.site-main,
.site-footer {
	position: relative;
	z-index: 1;
}

.site-main {
	flex: 1 0 auto;
}

::selection {
	background: var(--amber);
	color: #14110d;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--amber-hi);
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

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

.skip-link {
	position: absolute;
	left: -9999px;
	top: 8px;
	z-index: 10;
	padding: 10px 16px;
	background: var(--amber);
	color: #14110d;
}

.skip-link:focus {
	left: 8px;
}

/* ------------------------------------------------------------------
   Type
------------------------------------------------------------------- */
h1,
h2,
h3 {
	margin: 0 0 0.5em;
	font-family: var(--serif);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: 0.005em;
	color: var(--ink);
}

h1 {
	font-size: clamp(2.5rem, 10.5vw, 4.5rem);
}

h2 {
	font-size: clamp(1.75rem, 6vw, 2.5rem);
}

h3 {
	font-size: 1.5rem;
}

p {
	margin: 0 0 1.1em;
}

em {
	font-style: italic;
}

.lede {
	font-size: clamp(1.0625rem, 3.6vw, 1.25rem);
	color: var(--ink-dim);
	max-width: 32rem;
	margin-inline: auto;
}

.kicker {
	margin: 0 0 0.6em;
	font-size: 0.8125rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--amber);
}

.subtitle {
	margin: -0.2em 0 0.6em;
	font: 1.3125rem/1.35 var(--serif);
	color: var(--ink);
}

.gifts + .after {
	max-width: 36rem;
	margin: 0 auto 1.5rem;
	color: var(--ink-dim);
}

.center {
	text-align: center;
}

.rule {
	display: block;
	width: 56px;
	height: 1px;
	margin: 0 auto 1.4rem;
	background: var(--amber);
}

.textlink {
	font-weight: 500;
	letter-spacing: 0.02em;
}

/* ------------------------------------------------------------------
   Layout
------------------------------------------------------------------- */
.wrap {
	width: 100%;
	max-width: 64rem;
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.narrow {
	max-width: 38rem;
}

.hero {
	padding-block: clamp(32px, 8vw, 96px) clamp(36px, 8vw, 80px);
	text-align: center;
}

.hero .wrap > * {
	animation: rise 0.8s ease both;
}

.hero .wrap > *:nth-child(2) { animation-delay: 0.08s; }
.hero .wrap > *:nth-child(3) { animation-delay: 0.16s; }
.hero .wrap > *:nth-child(4) { animation-delay: 0.24s; }

@keyframes rise {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

.section {
	padding-block: clamp(40px, 9vw, 88px);
	border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------
   Signup form
------------------------------------------------------------------- */
.signup {
	display: grid;
	gap: 14px;
	margin-top: 1.75rem;
	text-align: left;
}

.field label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.8125rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-dim);
}

.field .opt {
	text-transform: none;
	letter-spacing: 0.02em;
	opacity: 0.8;
}

.field input {
	display: block;
	width: 100%;
	min-height: 52px;
	padding: 0 16px;
	font: inherit;
	font-size: 1rem; /* 16px stops iPhones zooming on focus */
	color: var(--ink);
	background: var(--bg-2);
	border: 1px solid var(--line);
	border-radius: 2px;
	-webkit-appearance: none;
	appearance: none;
}

.field input::placeholder {
	color: #8d8571;
}

.field input:focus {
	outline: 2px solid var(--amber);
	outline-offset: 2px;
	border-color: var(--amber);
}

.field--hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	padding: 0 28px;
	border: 0;
	border-radius: 2px;
	background: var(--amber);
	color: #14110d;
	font: 600 0.9375rem/1 var(--sans);
	letter-spacing: 0.16em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.btn:hover {
	background: var(--amber-hi);
	color: #14110d;
}

.btn:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 3px;
}

.btn[disabled] {
	opacity: 0.6;
	cursor: wait;
}

.btn--large {
	min-height: 60px;
	padding: 0 36px;
}

.cta {
	margin-top: 1.75rem;
}

.fine {
	font-size: 0.9375rem;
	color: var(--ink-dim);
}

.signup__note {
	margin: 0;
	font-size: 0.875rem;
	color: var(--ink-dim);
	text-align: center;
}

.signup__status {
	margin: 0;
	min-height: 1.4em;
	text-align: center;
	color: var(--ink);
}

.signup__status.is-error {
	color: #e0b27a;
}

.signup.is-done .field,
.signup.is-done .btn,
.signup.is-done .signup__note {
	display: none;
}

.signup.is-done .signup__status {
	padding: 22px 18px;
	border: 1px solid var(--line);
	background: var(--bg-2);
}

/* ------------------------------------------------------------------
   Home sections
------------------------------------------------------------------- */
.book {
	display: grid;
	gap: 32px;
	justify-items: center;
	text-align: center;
}

.book__cover {
	display: block;
	width: min(100%, 300px);
	line-height: 0;
}

.book__cover img {
	display: block;
	width: 100%;
	height: auto;
	box-shadow: 0 22px 44px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
	transition: transform 0.3s ease;
}

.book__cover:hover img {
	transform: translateY(-3px);
}

.slot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 280px;
	padding: 20px;
	border: 1px dashed var(--line);
	color: var(--ink-dim);
	font: italic 1rem/1.4 var(--serif);
	text-align: center;
}

.shelf {
	display: flex;
	justify-content: center;
}

.shelf__figure {
	margin: 0;
	width: min(100%, 300px);
}

.shelf__figure img {
	display: block;
	width: 100%;
	height: auto;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.shelf__figure figcaption {
	margin-top: 14px;
	font: italic 1rem/1.45 var(--serif);
	color: var(--ink-dim);
	text-align: center;
}

.gifts {
	margin: 2.25rem 0;
	padding: 0;
	list-style: none;
	counter-reset: gift;
	display: grid;
	gap: 28px;
}

.gifts li {
	counter-increment: gift;
	padding-top: 18px;
	border-top: 1px solid var(--line);
}

.gifts li::before {
	content: counter(gift, upper-roman);
	display: block;
	margin-bottom: 6px;
	font: 1.125rem/1 var(--serif);
	color: var(--amber);
}

.gifts h3 {
	margin-bottom: 0.3em;
}

.gifts p {
	margin: 0;
	color: var(--ink-dim);
}

@media (min-width: 720px) {
	.book {
		grid-template-columns: minmax(0, 300px) 1fr;
		gap: 64px;
		justify-items: start;
		text-align: left;
	}

	.gifts {
		grid-template-columns: repeat(2, 1fr);
		gap: 36px;
	}
}

/* ------------------------------------------------------------------
   Content pages (/privacy, /make)
------------------------------------------------------------------- */
.page-content {
	padding-block: clamp(40px, 9vw, 88px);
}

.page-head {
	text-align: center;
	margin-bottom: 2.25rem;
}

.page-head h1 {
	font-size: clamp(2.1rem, 8vw, 3.25rem);
}

.prose h2 {
	margin-top: 2.2em;
	font-size: 1.625rem;
}

.prose p,
.prose li {
	color: #d9d1bf;
}

.prose ul,
.prose ol {
	padding-left: 1.3em;
	margin: 0 0 1.2em;
}

.prose li {
	margin-block: 0.45em;
}

.prose li::marker {
	color: var(--amber);
	font-family: var(--serif);
}

.prose hr {
	margin-block: 2.5em;
	border: 0;
	border-top: 1px solid var(--line);
}

.prose h3 {
	margin-top: 1.8em;
	font-size: 1.3125rem;
}

.prose blockquote {
	margin: 1.6em 0;
	padding: 14px 18px;
	border-left: 2px solid var(--amber);
	background: var(--bg-2);
}

.prose blockquote p {
	margin: 0;
}

.prose .note {
	padding: 16px 18px;
	border-left: 2px solid var(--amber);
	background: var(--bg-2);
}

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------- */
.site-footer {
	border-top: 1px solid var(--line);
	padding-block: 28px 36px;
	font-size: 0.875rem;
	color: var(--ink-dim);
}

.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	align-items: center;
	justify-content: center;
}

.site-footer p {
	margin: 0;
}

.site-footer a {
	color: var(--ink-dim);
}

.site-footer a:hover {
	color: var(--amber-hi);
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.hero .wrap > * { animation: none; }
	.book__cover img { transition: none; }
}
