/* ============================================================
   Ah Whoooo! — catsies.andrew-downey.com
   Hand-authored, dependency-free stylesheet.
   ============================================================ */

/* ---------- Fonts (self-hosted, latin subsets) ---------- */
@font-face {
	font-family: 'Fraunces';
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url('/fonts/fraunces-normal-latin.woff2') format('woff2');
}
@font-face {
	font-family: 'Fraunces';
	font-style: italic;
	font-weight: 400 700;
	font-display: swap;
	src: url('/fonts/fraunces-italic-latin.woff2') format('woff2');
}
@font-face {
	font-family: 'Nunito';
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url('/fonts/nunito-latin.woff2') format('woff2');
}

/* ---------- Design tokens ---------- */
:root {
	--cream:      #FBF6EF;
	--ink:        #3A2C28;
	--ink-soft:   #7C6A61;

	--rose:       #D9717F;
	--rose-deep:  #B24A5C;
	--denim:      #5C7CA8;
	--denim-deep: #3F5C86;

	--font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Times New Roman', serif;
	--font-body: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

	--radius: 26px;
	--shadow-card: 0 30px 60px -35px rgba(97, 58, 48, .45), 0 2px 6px -2px rgba(97, 58, 48, .12);
}

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

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

body {
	margin: 0;
	min-height: 100svh;
	font-family: var(--font-body);
	font-optical-sizing: auto;
	font-size: clamp(1rem, .95rem + .3vw, 1.08rem);
	line-height: 1.6;
	color: var(--ink);
	background: var(--cream);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

img { max-width: 100%; }
::selection { background: var(--rose); color: #fff; }

:where(a, button, [tabindex]):focus-visible {
	outline: 2px solid var(--denim-deep);
	outline-offset: 3px;
	border-radius: 6px;
}

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

/* ---------- Atmosphere: warm glows + fine grain ---------- */
.atmosphere {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		radial-gradient(65vw 55vw at 12% -8%,  rgba(246, 206, 196, .85), transparent 60%),
		radial-gradient(55vw 50vw at 98% 4%,   rgba(214, 224, 246, .75), transparent 62%),
		radial-gradient(40vw 40vw at 82% 58%,  rgba(231, 225, 242, .55), transparent 70%),
		radial-gradient(72vw 60vw at 50% 112%, rgba(240, 214, 196, .70), transparent 66%);
}
.atmosphere::after {
	content: '';
	position: absolute;
	inset: 0;
	opacity: .5;
	mix-blend-mode: soft-light;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ---------- Page layout ---------- */
.page {
	width: min(100% - 2rem, 46rem);
	margin-inline: auto;
	padding-block: clamp(2.2rem, 7vw, 4.5rem) 1rem;
	display: grid;
	gap: clamp(1.3rem, 3.4vw, 2.1rem);
}

/* ---------- Hero ---------- */
.hero { text-align: center; }

.kicker {
	margin: 0 0 .35rem;
	text-transform: uppercase;
	letter-spacing: .22em;
	font-size: .72rem;
	font-weight: 700;
	color: var(--rose-deep);
}
.kicker time { font-weight: 700; }

.title {
	margin: .1em 0 .25em;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: clamp(3rem, 13vw, 6.6rem);
	line-height: .92;
	letter-spacing: -.02em;
	background: linear-gradient(178deg, #4A3630 0%, #7A4640 52%, #B24A5C 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	text-wrap: balance;
}
.lede {
	margin: 0;
	color: var(--ink-soft);
	font-size: clamp(1rem, 2.6vw, 1.18rem);
}

/* ---------- Card shell ---------- */
.card {
	background: rgba(255, 255, 255, .62);
	border: 1px solid rgba(255, 255, 255, .8);
	border-radius: var(--radius);
	padding: clamp(1.5rem, 4.5vw, 2.5rem);
	box-shadow: var(--shadow-card);
	backdrop-filter: blur(14px) saturate(1.15);
	-webkit-backdrop-filter: blur(14px) saturate(1.15);
}

/* ---------- Counter ---------- */
.counter-card { text-align: center; }

.counter-card__label {
	margin: 0;
	text-transform: uppercase;
	letter-spacing: .18em;
	font-size: .72rem;
	font-weight: 700;
	color: var(--ink-soft);
}

.counter { display: grid; gap: .1rem; margin-top: .5rem; }

.counter__row {
	display: flex;
	justify-content: center;
	align-items: baseline;
	gap: clamp(.7rem, 3.5vw, 1.6rem);
	flex-wrap: wrap;
}
.counter__row--small { margin-top: .45rem; }

.unit {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	min-width: 3.6ch;
}
.unit b {
	font-family: var(--font-display);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	font-feature-settings: 'tnum' 1;
	line-height: 1;
}
.unit i {
	font-style: normal;
	margin-top: .5em;
	font-size: .66rem;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--ink-soft);
}
.counter__row--big .unit b { font-size: clamp(2.2rem, 8.5vw, 4rem); color: var(--rose-deep); }
.counter__row--small .unit b { font-size: clamp(1.15rem, 4.4vw, 1.6rem); color: var(--denim-deep); }
.unit--seconds b { transition: color .3s ease; }
.unit--seconds.is-ticking b { color: var(--rose-deep); }

.counter-card__note {
	margin: 1.2rem 0 0;
	color: var(--ink-soft);
}
.accent {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.3em;
	color: var(--rose-deep);
	font-variant-numeric: tabular-nums;
}

/* ---------- Photos ---------- */
.photos {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: clamp(1.1rem, 4.5vw, 2.6rem);
}
.polaroid {
	margin: 0;
	width: min(40%, 15rem);
	background: #fff;
	padding: .7rem .7rem 2.6rem;
	border-radius: 12px;
	box-shadow: 0 24px 45px -28px rgba(80, 50, 40, .6), 0 2px 4px -2px rgba(80, 50, 40, .2);
	transform: rotate(-2.4deg);
	transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .5s ease;
}
.polaroid--b { transform: rotate(2.2deg); }
.polaroid:hover { transform: rotate(0deg) translateY(-5px); box-shadow: 0 34px 55px -28px rgba(80, 50, 40, .65); }
.polaroid img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 9 / 16;
	object-fit: cover;
	border-radius: 7px;
	background: #EFE6DC;
}

/* ---------- Stats ---------- */
.stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: clamp(.7rem, 2.6vw, 1rem);
}
.stat {
	text-align: center;
	padding: clamp(.9rem, 3vw, 1.35rem) .6rem;
	background: rgba(255, 255, 255, .5);
	border: 1px solid rgba(255, 255, 255, .75);
	border-radius: 18px;
	box-shadow: 0 18px 35px -28px rgba(97, 58, 48, .6);
}
.stat b {
	display: block;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: clamp(1.5rem, 5.5vw, 2.2rem);
	line-height: 1;
	color: var(--rose-deep);
	font-variant-numeric: tabular-nums;
}
.stat span {
	display: block;
	margin-top: .45em;
	font-size: .72rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ink-soft);
}

/* ---------- Breakdown / timelines ---------- */
.breakdown { display: grid; gap: clamp(1.1rem, 3vw, 1.7rem); }

.section-title {
	margin: 0;
	text-align: center;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: clamp(1.55rem, 5.2vw, 2.15rem);
	letter-spacing: -.01em;
	color: var(--ink);
}

.timeline { display: grid; gap: .6rem; }
.timeline__caption {
	margin: 0;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: .16em;
	font-size: .72rem;
	font-weight: 700;
	color: var(--ink-soft);
}

.bar {
	position: relative;
	height: clamp(60px, 16vw, 78px);
	border-radius: 16px;
	overflow: hidden;
	background: rgba(255, 255, 255, .45);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 22px 40px -30px rgba(97, 58, 48, .7);
}
.bar__fill {
	display: flex;
	height: 100%;
	width: 0;
	transition: width 1.15s cubic-bezier(.22, .75, .25, 1);
}
.timeline.is-visible .bar__fill { width: 100%; }

.seg {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	width: calc(var(--w, 0) * 1%);
	overflow: hidden;
}
.seg::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%);
	pointer-events: none;
}
.seg__label {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .12em;
	padding: 0 .45rem;
	text-align: center;
	white-space: nowrap;
}
.seg__label b {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: clamp(.95rem, 3.5vw, 1.35rem);
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.seg__label small {
	font-size: clamp(.55rem, 1.9vw, .68rem);
	line-height: 1.1;
	letter-spacing: .03em;
	opacity: .95;
}

.seg--before  { background: linear-gradient(180deg, #DACFC4, #CBBBAC); color: #4A3B33; }
.seg--dating  { background: linear-gradient(180deg, #7E99C0, #5C7CA8); color: #fff; }
.seg--married { background: linear-gradient(180deg, #E28D99, #D9717F); color: #fff; }
.seg--dogless { background: linear-gradient(180deg, #F1D4D8, #E9C2C8); color: #9E3E4D; }
.seg--jake    { background: linear-gradient(180deg, #C8D6EC, #AFC2E0); color: #33517A; }
.seg--jenny   { background: linear-gradient(180deg, #E28D99, #D9717F); color: #fff; }

/* ---------- Note ---------- */
.note { text-align: center; }
.note p { margin: 0; }
.note p + p { margin-top: .8rem; }
.note__aside {
	font-family: var(--font-display);
	font-style: italic;
	font-size: 1.15em;
	color: var(--rose-deep);
}

/* ---------- Footer ---------- */
.footer {
	margin-top: 1rem;
	padding: 2rem 1rem 3rem;
	text-align: center;
	color: var(--ink-soft);
	font-size: .82rem;
	letter-spacing: .04em;
}
.footer .heart {
	display: inline-block;
	color: var(--rose);
	animation: beat 2.6s ease-in-out infinite;
}
@keyframes beat {
	0%, 100% { transform: scale(1); }
	18%      { transform: scale(1.22); }
	36%      { transform: scale(1); }
}

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1);
	transition-delay: var(--reveal-delay, 0s);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Wider screens ---------- */
@media (min-width: 34rem) {
	.stats { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Small screens ---------- */
@media (max-width: 26rem) {
	.polaroid { width: min(72%, 16rem); }
	.counter__row { gap: .7rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
	}
	[data-reveal] { opacity: 1; transform: none; }
	.bar__fill { width: 100% !important; }
	.footer .heart { animation: none; }
}

/* ---------- Print ---------- */
@media print {
	.atmosphere { display: none; }
	body { background: #fff; }
	.card, .stat, .bar { box-shadow: none; }
}
