/*
Theme Name: CM Files
Theme URI: https://calebfiles.com
Author: Caleb-Michael Files
Description: Playful one-page personal site. All homepage content is edited in the WordPress page editor (Pages → Home).
Version: 2.0.0
Requires at least: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cmfiles
*/

:root {
	--ink: #14213D;
	--ground: #FBFAFF;
	--white: #FFFFFF;
	--muted: #46516F;
	--line: #D9DCE9;
	--accent: #2B3FE0;
	--sky: #CFE2FF;
	--mint: #C9F0DC;
	--butter: #FFE8A3;
	--blush: #FFD0DA;
	--lilac: #DFD3FF;
	--display: 'Bricolage Grotesque', 'Trebuchet MS', system-ui, sans-serif;
	--body: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
	--gutter: max(24px, calc((100% - 1160px) / 2));
	--shadow: 5px 5px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: var(--body);
	font-size: 18px;
	line-height: 1.6;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.cmf-skip { position: absolute; left: -9999px; top: 0; background: var(--white); color: var(--ink); padding: 12px 16px; font-weight: 700; z-index: 100; }
.cmf-skip:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.cmf-header { position: sticky; top: 14px; z-index: 60; padding: 0 16px; margin-top: 14px; pointer-events: none; }
body.admin-bar .cmf-header { top: 46px; }
.cmf-header__pill {
	pointer-events: auto; max-width: 1160px; margin: 0 auto;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	background: var(--white); border: 2px solid var(--ink); border-radius: 999px;
	padding: 8px 8px 8px 24px; box-shadow: var(--shadow);
	transition: box-shadow .25s ease, translate .25s ease;
}
.cmf-header.is-scrolled .cmf-header__pill { box-shadow: 3px 3px 0 var(--ink); }
.cmf-name { font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.cmf-name:hover { color: var(--accent); }
.cmf-nav__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.cmf-nav__list a {
	display: block; padding: 9px 16px; border-radius: 999px; border: 2px solid transparent;
	color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
	transition: background-color .2s ease, rotate .2s ease;
}
.cmf-nav__list a:hover { background: var(--butter); rotate: -2deg; }
.cmf-nav__list a.is-active { background: var(--lilac); }
.cmf-nav__list li:last-child a { background: var(--ink); color: var(--white); }
.cmf-nav__list li:last-child a:hover { background: var(--accent); color: var(--white); rotate: 2deg; }

/* ---------- Shared ---------- */
.cmf-title {
	font-family: var(--display); font-weight: 800;
	font-size: clamp(38px, 5vw, 64px); line-height: 1; letter-spacing: -0.035em;
	margin: 0 0 44px; text-wrap: balance;
}

:is(.cmf-hero, .cmf-contact, .cmf-prose) .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 16px; }
:is(.cmf-hero, .cmf-contact, .cmf-prose) .wp-block-button { margin: 0; }
:is(.cmf-hero, .cmf-contact, .cmf-prose) .wp-block-button__link {
	display: inline-block; background-color: var(--accent); color: var(--white);
	border: 2px solid var(--ink); border-radius: 999px; padding: 14px 28px;
	font-family: var(--body); font-weight: 700; font-size: 17px; line-height: 1.3; text-decoration: none;
	box-shadow: var(--shadow); transition: translate .15s ease, box-shadow .15s ease;
}
:is(.cmf-hero, .cmf-contact, .cmf-prose) .wp-block-button__link:hover { translate: 3px 3px; box-shadow: 2px 2px 0 var(--ink); color: var(--white); }
:is(.cmf-hero, .cmf-contact, .cmf-prose) .wp-block-button__link:active { translate: 5px 5px; box-shadow: 0 0 0 var(--ink); }
:is(.cmf-hero, .cmf-prose) .wp-block-button.is-style-outline > .wp-block-button__link { background-color: var(--white); color: var(--ink); padding: 14px 28px; }

/* ---------- Hero ---------- */
.cmf-hero {
	position: relative; overflow: clip;
	padding: 96px var(--gutter) 104px;
	display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); column-gap: 40px; align-content: start;
}
.cmf-hero::before, .cmf-hero::after {
	content: ""; position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none;
	animation: cmf-float 16s ease-in-out infinite alternate;
}
.cmf-hero::before { width: 460px; height: 460px; right: -80px; top: -120px; background: var(--blush); }
.cmf-hero::after { width: 380px; height: 380px; right: 22%; bottom: -200px; background: var(--sky); animation-delay: -8s; }
.cmf-hero > * { grid-column: 1; position: relative; z-index: 1; margin: 0; }
.cmf-hello { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.02em; margin-bottom: 14px; }
.cmf-hello::after {
	content: ""; display: inline-block; width: .9em; height: .9em; margin-left: .35em; vertical-align: -0.08em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c1 7 5 11 12 12-7 1-11 5-12 12-1-7-5-11-12-12 7-1 11-5 12-12z' fill='%232B3FE0'/%3E%3C/svg%3E") center / contain no-repeat;
	animation: cmf-twinkle 3.2s ease-in-out infinite;
}
.cmf-headline {
	font-family: var(--display); font-weight: 800;
	font-size: clamp(40px, 4.9vw, 64px); line-height: 1.02; letter-spacing: -0.04em;
	margin-bottom: 28px;
}
.cmf-headline em {
	font-style: normal; display: block; width: fit-content; max-width: 100%; color: var(--accent);
	padding-bottom: .14em; min-height: 1.16em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 4c5-5 10-5 15 0s10 5 15 0 7-3 10 0' fill='none' stroke='%23FFB3C1' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") left bottom / 40px 8px repeat-x;
	animation: cmf-squiggle 1.6s linear infinite;
	transition: opacity .22s ease, transform .22s ease;
}
.cmf-headline em.is-out { opacity: 0; transform: translateY(.25em) rotate(-2deg); }
.cmf-page .cmf-rotate-words { display: none; }
.cmf-lede { font-size: 20px; color: var(--muted); max-width: 580px; margin-bottom: 34px; text-wrap: pretty; }

.cmf-stickers { grid-column: 2; grid-row: 1 / span 6; position: relative; min-height: 420px; }
.cmf-sticker {
	position: absolute; margin: 0; white-space: nowrap;
	font-family: var(--display); font-weight: 800; font-size: clamp(18px, 1.9vw, 26px); letter-spacing: -0.02em; line-height: 1.2;
	padding: 14px 24px; background: var(--white); border: 2px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow);
	animation: cmf-bob 5s ease-in-out infinite; transition: scale .2s ease, box-shadow .2s ease;
}
.cmf-sticker:nth-child(1) { top: 6%; left: 2%; rotate: -7deg; background: var(--ink); color: var(--white); box-shadow: 5px 5px 0 var(--accent); }
.cmf-sticker:nth-child(2) { top: 27%; left: 20%; rotate: 5deg; background: var(--butter); animation-delay: -1.2s; }
.cmf-sticker:nth-child(3) { top: 50%; left: -6%; rotate: -3deg; background: var(--blush); animation-delay: -2.4s; }
.cmf-sticker:nth-child(4) { top: 74%; left: 16%; rotate: 6deg; background: var(--mint); animation-delay: -3.6s; }
.cmf-sticker:nth-child(5) { top: 94%; left: 0; rotate: -4deg; background: var(--sky); animation-delay: -0.6s; }
.cmf-js .cmf-sticker.is-draggable { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
.cmf-js .cmf-sticker.is-dragging { cursor: grabbing; scale: 1.06; z-index: 5; animation-play-state: paused; box-shadow: 10px 10px 0 var(--ink); }

/* ---------- Relocation band ---------- */
.cmf-band { background: var(--ink); color: var(--white); padding: 30px 0 36px; overflow: hidden; }
.cmf-band__label { margin: 0 0 8px; padding: 0 var(--gutter); font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--butter); }
.cmf-marquee {
	list-style: none; margin: 0; padding: 0 var(--gutter); display: flex; flex-wrap: wrap;
	font-family: var(--display); font-weight: 800; font-size: clamp(34px, 5vw, 64px); line-height: 1.15; letter-spacing: -0.03em;
}
.cmf-marquee li { padding-right: 28px; white-space: nowrap; }
.cmf-marquee li::after { content: "✦"; margin-left: 28px; color: var(--butter); font-size: .6em; vertical-align: .22em; }
.cmf-marquee li:nth-child(4n+1) { color: var(--sky); }
.cmf-marquee li:nth-child(4n+2) { color: var(--blush); }
.cmf-marquee li:nth-child(4n+3) { color: var(--mint); }
.cmf-marquee li:nth-child(4n+4) { color: var(--lilac); }
.cmf-marquee.is-running { flex-wrap: nowrap; width: max-content; padding: 0; animation: cmf-marquee var(--dur, 30s) linear infinite; }
.cmf-band:hover .cmf-marquee.is-running { animation-play-state: paused; }

/* ---------- Stats ---------- */
.cmf-stats { padding: 96px var(--gutter) 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 26px; }
.cmf-stat { border: 2px solid var(--ink); border-radius: 28px; padding: 28px 26px 26px; box-shadow: var(--shadow); transition: rotate .3s ease, translate .3s ease; }
.cmf-stat:nth-child(4n+1) { background: var(--butter); rotate: -1.5deg; }
.cmf-stat:nth-child(4n+2) { background: var(--sky); rotate: 1deg; }
.cmf-stat:nth-child(4n+3) { background: var(--blush); rotate: -1deg; }
.cmf-stat:nth-child(4n+4) { background: var(--mint); rotate: 1.5deg; }
.cmf-stat:hover { rotate: 0deg; translate: 0 -6px; }
.cmf-stat p { margin: 0; font-size: 16px; line-height: 1.45; }
.cmf-stat .cmf-stat__num { font-family: var(--display); font-weight: 800; font-size: clamp(48px, 5vw, 68px); line-height: 1; letter-spacing: -0.04em; margin-bottom: 12px; font-variant-numeric: tabular-nums; }

/* ---------- What I do ---------- */
.cmf-strengths { padding: 96px var(--gutter); }
.cmf-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 28px; }
.cmf-card { background: var(--white); border: 2px solid var(--ink); border-radius: 28px; padding: 30px; box-shadow: var(--shadow); transition: translate .2s ease, box-shadow .2s ease; }
.cmf-card:hover { translate: -4px -4px; box-shadow: 9px 9px 0 var(--ink); }
.cmf-card p { margin: 0; font-size: 17px; color: var(--muted); text-wrap: pretty; }
.cmf-card .cmf-card__num {
	width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink);
	display: flex; align-items: center; justify-content: center;
	font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--ink);
	transition: rotate .4s cubic-bezier(.3, 1.6, .5, 1);
}
.cmf-card:nth-child(3n+1) .cmf-card__num { background: var(--lilac); }
.cmf-card:nth-child(3n+2) .cmf-card__num { background: var(--butter); }
.cmf-card:nth-child(3n+3) .cmf-card__num { background: var(--mint); }
.cmf-card:hover .cmf-card__num { rotate: 360deg; }
.cmf-card h3 { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.1; letter-spacing: -0.025em; margin: 20px 0 10px; }

/* ---------- Experience ---------- */
.cmf-experience { padding: 96px var(--gutter); background: var(--white); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.cmf-roles { position: relative; padding-left: 44px; }
.cmf-roles::before, .cmf-roles__progress { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; }
.cmf-roles::before { background: var(--line); }
.cmf-roles__progress { background: var(--accent); transform-origin: top; transform: scaleY(var(--p, 0)); }
.cmf-role { position: relative; display: grid; grid-template-columns: 210px minmax(0, 1fr); column-gap: 40px; padding: 30px 0; border-top: 2px dashed var(--line); }
.cmf-role:first-of-type { border-top: 0; padding-top: 0; }
.cmf-role:last-of-type { padding-bottom: 0; }
.cmf-role::before {
	content: ""; position: absolute; left: -44px; top: 36px; width: 17px; height: 17px; border-radius: 50%;
	background: var(--white); border: 3px solid var(--ink);
	transition: background-color .3s ease, scale .3s cubic-bezier(.3, 1.8, .5, 1);
}
.cmf-role:first-of-type::before { top: 6px; }
.cmf-role.is-active::before { background: var(--butter); scale: 1.25; }
.cmf-role > * { grid-column: 2; margin: 0; }
.cmf-role .cmf-role__meta { grid-column: 1; grid-row: 1 / span 4; font-size: 14px; font-weight: 700; letter-spacing: .03em; color: var(--muted); padding-top: 6px; }
.cmf-role h3 { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.15; letter-spacing: -0.025em; }
.cmf-role .cmf-role__org { width: fit-content; margin: 12px 0 14px; padding: 3px 14px; border: 2px solid var(--ink); border-radius: 999px; font-size: 15px; font-weight: 700; background: var(--lilac); }
.cmf-role:nth-child(4n+2) .cmf-role__org { background: var(--mint); }
.cmf-role:nth-child(4n+3) .cmf-role__org { background: var(--butter); }
.cmf-role:nth-child(4n+4) .cmf-role__org { background: var(--blush); }
.cmf-role ul { padding-left: 20px; font-size: 17px; color: var(--muted); }
.cmf-role li + li { margin-top: 8px; }

/* ---------- Credentials ---------- */
.cmf-credentials { padding: 96px var(--gutter); }
.cmf-cred-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 28px; }
.cmf-cred { background: var(--white); border: 2px solid var(--ink); border-radius: 28px; padding: 28px; box-shadow: var(--shadow); }
.cmf-cred h3 { margin: 0 0 16px; width: fit-content; padding: 4px 14px; border-radius: 999px; background: var(--ink); color: var(--white); font-family: var(--body); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cmf-cred p { margin: 0 0 6px; font-size: 17px; }
.cmf-cred p strong { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; }
.cmf-certs { list-style: none; margin: 0; padding: 0; font-size: 16px; color: var(--muted); }
.cmf-certs li + li { margin-top: 14px; }
.cmf-certs strong { color: var(--ink); font-size: 17px; }
.cmf-tools { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.cmf-tools li { padding: 7px 14px; border: 2px solid var(--ink); border-radius: 999px; font-size: 15px; font-weight: 600; transition: rotate .2s ease, translate .2s ease; }
.cmf-tools li:nth-child(5n+1) { background: var(--sky); }
.cmf-tools li:nth-child(5n+2) { background: var(--butter); }
.cmf-tools li:nth-child(5n+3) { background: var(--mint); }
.cmf-tools li:nth-child(5n+4) { background: var(--blush); }
.cmf-tools li:nth-child(5n+5) { background: var(--lilac); }
.cmf-tools li:nth-child(odd):hover { rotate: -4deg; translate: 0 -3px; }
.cmf-tools li:nth-child(even):hover { rotate: 4deg; translate: 0 -3px; }

/* ---------- Contact ---------- */
.cmf-contact { position: relative; overflow: hidden; margin: 0 16px 16px; border-radius: 40px; background: var(--ink); color: var(--white); padding: 96px max(24px, calc((100% - 1160px) / 2)); }
.cmf-contact::after {
	content: ""; position: absolute; right: 6%; top: 48px; width: 120px; height: 120px; pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c1 7 5 11 12 12-7 1-11 5-12 12-1-7-5-11-12-12 7-1 11-5 12-12z' fill='%23FFE8A3'/%3E%3C/svg%3E") center / contain no-repeat;
	animation: cmf-spin 14s linear infinite;
}
.cmf-contact > * { position: relative; z-index: 1; }
.cmf-contact__title { font-family: var(--display); font-weight: 800; font-size: clamp(38px, 5.6vw, 76px); line-height: 1; letter-spacing: -0.04em; margin: 0 0 40px; max-width: 900px; text-wrap: balance; }
.cmf-contact .wp-block-button__link { background-color: var(--butter); color: var(--ink); border-color: var(--butter); box-shadow: 5px 5px 0 var(--accent); }
.cmf-contact .wp-block-button__link:hover { color: var(--ink); box-shadow: 2px 2px 0 var(--accent); }
.cmf-contact .wp-block-button.is-style-outline > .wp-block-button__link { background-color: transparent; color: var(--white); border-color: var(--white); padding: 14px 28px; box-shadow: 5px 5px 0 var(--blush); }
.cmf-contact .wp-block-button.is-style-outline > .wp-block-button__link:hover { color: var(--white); box-shadow: 2px 2px 0 var(--blush); }
.cmf-contact .cmf-contact__note { margin: 36px 0 0; font-size: 17px; color: #C9D1E8; }

/* ---------- Footer, other pages ---------- */
.cmf-footer { padding: 24px var(--gutter) 40px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 15px; color: var(--muted); }
.cmf-footer p { margin: 0; }
.cmf-footer a { color: var(--muted); font-weight: 600; }
.cmf-footer a:hover { color: var(--accent); }
.cmf-prose { max-width: 760px; margin: 0 auto; padding: 72px 24px 96px; }
.cmf-prose h1 { font-family: var(--display); font-weight: 800; font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 28px; }
.cmf-prose h2, .cmf-prose h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }

/* ---------- Motion ---------- */
section[id] { scroll-margin-top: 96px; }
.cmf-js .cmf-reveal { opacity: 0; transform: translateY(28px) scale(.97); transition: opacity .6s ease, transform .7s cubic-bezier(.2, .9, .3, 1.2); }
.cmf-js .cmf-reveal.is-in { opacity: 1; transform: none; }
.cmf-confetti { position: fixed; z-index: 200; width: 10px; height: 14px; border-radius: 3px; pointer-events: none; }

@keyframes cmf-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes cmf-float { to { transform: translate(-60px, 40px) scale(1.12); } }
@keyframes cmf-twinkle { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.3) rotate(45deg); } }
@keyframes cmf-squiggle { to { background-position: 40px bottom; } }
@keyframes cmf-marquee { to { transform: translateX(-50%); } }
@keyframes cmf-spin { to { transform: rotate(360deg); } }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
	.cmf-hero { grid-template-columns: minmax(0, 1fr); padding-top: 64px; padding-bottom: 72px; }
	.cmf-hero .cmf-stickers { grid-column: 1; grid-row: auto; min-height: 0; margin-top: 44px; display: flex; flex-wrap: wrap; gap: 14px 12px; }
	.cmf-sticker, .cmf-sticker:nth-child(n) { position: relative; top: auto; left: auto; font-size: 18px; padding: 10px 18px; white-space: normal; }
}
@media (max-width: 700px) {
	body { font-size: 17px; }
	.cmf-nav__list li:not(:last-child) { display: none; }
	.cmf-header__pill { padding-left: 18px; }
	.cmf-name { font-size: 18px; }
	.cmf-headline { min-height: 5.1em; }
	.cmf-hero::before { width: 300px; height: 300px; right: -120px; top: -140px; }
	.cmf-stats, .cmf-strengths, .cmf-experience, .cmf-credentials { padding-top: 64px; }
	.cmf-strengths, .cmf-experience, .cmf-credentials { padding-bottom: 64px; }
	.cmf-roles { padding-left: 32px; }
	.cmf-role { grid-template-columns: minmax(0, 1fr); }
	.cmf-role::before { left: -32px; }
	.cmf-role .cmf-role__meta { grid-column: 1; grid-row: auto; padding: 0 0 8px; }
	.cmf-role > * { grid-column: 1; }
	.cmf-role__meta br { display: none; }
	.cmf-contact { padding-top: 72px; padding-bottom: 72px; border-radius: 28px; margin: 0 10px 10px; }
	.cmf-contact::after { width: 64px; height: 64px; top: 20px; right: 20px; opacity: .5; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.cmf-hero::before, .cmf-hero::after, .cmf-hello::after, .cmf-headline em, .cmf-sticker, .cmf-contact::after, .cmf-marquee.is-running { animation: none; }
	.cmf-js .cmf-reveal { opacity: 1; transform: none; transition: none; }
	.cmf-stat, .cmf-card, .cmf-card .cmf-card__num, .cmf-tools li, .cmf-nav__list a, .cmf-headline em { transition: none; }
}
